Advertisement
npocmaka

codepages.bat

Sep 21st, 2014
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @if (@X)==(@Y) @end /****** jscript comment ******
  2.  
  3. @echo off
  4. ::::::::::::::::::::::::::::::::::::
  5. :::       compile the script    ::::
  6. ::::::::::::::::::::::::::::::::::::
  7. setlocal
  8.  
  9. if exist "%~n0.exe" goto :skip_compilation
  10.  
  11. :: searching the latest installed .net framework
  12. for /f "tokens=* delims=" %%v in ('dir /b /s /a:d /o:-n "%SystemRoot%\Microsoft.NET\Framework\v*"') do (
  13.     if exist "%%v\jsc.exe" (
  14.         rem :: the javascript.net compiler
  15.         rem echo %%~dpsnfxv
  16.         set "jsc=%%~dpsnfxv\jsc.exe"
  17.         goto :break_loop
  18.     )
  19. )
  20. echo jsc.exe not found && exit /b 0
  21. :break_loop
  22.  
  23.  
  24. call %jsc% /nologo /out:"%~n0.exe" "%~f0"
  25. ::::::::::::::::::::::::::::::::::::
  26. :::       end of compilation    ::::
  27. ::::::::::::::::::::::::::::::::::::
  28. :skip_compilation
  29.  
  30. ::
  31. ::::::::::
  32. "%~n0.exe"
  33. ::::::::
  34. ::
  35.  
  36. exit /b 0
  37.  
  38. ## http://msdn.microsoft.com/en-us/library/system.text.encoding.getencodings.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-2
  39. ##
  40.  
  41. ****** end of jscript comment ******/
  42.  
  43. import System;
  44. import System.Text;
  45.  
  46. Console.Write( "CodePage identifier and name     " );
  47. Console.Write( "BrDisp   BrSave   " );
  48. Console.Write( "MNDisp   MNSave   " );
  49. Console.WriteLine( "1-Byte   ReadOnly " );
  50.  
  51. var ei=  new Object();
  52. var encs=new Enumerator(Encoding.GetEncodings());
  53.    
  54. while(!encs.atEnd()) {
  55.     var enc=encs.item();
  56.     var e=enc.GetEncoding();
  57.        
  58.     Console.Write( "{0,-6} {1,-25} ", enc.CodePage, enc.Name );
  59.     Console.Write( "{0,-8} {1,-8} ", e.IsBrowserDisplay, e.IsBrowserSave );
  60.     Console.Write( "{0,-8} {1,-8} ", e.IsMailNewsDisplay, e.IsMailNewsSave );
  61.     Console.WriteLine( "{0,-8} {1,-8} ", e.IsSingleByte, e.IsReadOnly );
  62.          
  63.     encs.moveNext();
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement