Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.16 KB | None | 0 0
  1.         private string GetZeroTerm(FileStream bStream, BinaryReader bReader, int postion)
  2.         {
  3.             bStream.Position = postion;//Set the start postion
  4.             var returnString = "";
  5.             byte cChar;
  6.             var tempString = "";
  7.             bool ruRU = false; //if ruRU cache
  8.             while ((cChar = bReader.ReadByte()) != 0) //While there is no null keep reading
  9.             {
  10.                  tempString = ((char)cChar).ToString();
  11.                 if (ruRU & cChar > 143)
  12.                 {
  13.                     tempString = ((char)(cChar + 896)).ToString(); //Save each byte
  14.                     ruRU = false;
  15.                 }
  16.                 if (ruRU & cChar < 144)
  17.                 {
  18.                     tempString = ((char)(cChar + 960)).ToString();
  19.                     ruRU = false;
  20.                 }
  21.  
  22.                 if (cChar == 209 || cChar == 208)
  23.                 {
  24.                     ruRU = true;
  25.                     tempString = "";
  26.                 }
  27.                 returnString += tempString;
  28.                // returnString += (char) cChar;
  29.             }
  30.             return returnString;//Give me the string
  31.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement