public static byte ToTvcBasicAscii(this char c) { if (HungarianTvcBasicAsciiChars.ContainsKey(c)) { return(HungarianTvcBasicAsciiChars[c]); } byte convertedByte = Encoding.ASCII.GetBytes(new[] { c })[0]; if (convertedByte == 0x3F && c != '?') { throw new TvcBasicException($"A '{c}' karakter nem ASCII karakter!"); } return(convertedByte); }
public static bool IsTvcBasicAscii(this char c) { if (HungarianTvcBasicAsciiChars.ContainsKey(c)) { return(true); } byte convertedByte = Encoding.ASCII.GetBytes(new[] { c })[0]; // Encoding.ASCII.GetBytes returns with '0x3F' if the input character is greather than 7F if (convertedByte == 0x3F && c != '?') { return(false); } return(true); }