SHARE
TWEET

all chars in codepage

a guest Feb 26th, 2018 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private byte[] GetByteArray(int Code, int Len)
  2.         {
  3.             byte[] Ret = new byte[Len];
  4.             byte[] conv = BitConverter.GetBytes(Code);
  5.  
  6.             for (int i = 0; i < Len; i++)
  7.             {
  8.                 Ret[i] = conv[i];
  9.             }
  10.  
  11.             return Ret;
  12.         }
  13.                        ........................
  14.                         int CP = 1251;
  15.                         Encoding enc = Encoding.GetEncoding(CP);
  16.                         int maxbyte = enc.GetMaxByteCount(1);                            
  17.            
  18.                         string[] tbl = new string[maxbyte];
  19.  
  20.                         for (int i = 1; i <= maxbyte; i++)
  21.                         {
  22.                             for (Int64 j = 0; j < int.MaxValue; j++)
  23.                             {
  24.                                 byte[] chrbuf = GetByteArray((int)j, i);
  25.                                 tbl[i]=tbl[i]+enc.GetString(chrbuf);
  26.                             }
  27.                         }
  28.  
  29.                         MessageBox.Show(char.MaxValue.ToString() + " ");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top