public static byte ToTvcAscii(this char c) { if (HungarianTvcAsciiChars.ContainsKey(c)) { return(HungarianTvcAsciiChars[c]); } byte convertedByte = Encoding.ASCII.GetBytes(new[] { c })[0]; if (convertedByte == 0x3F && c != '?') { throw new Z80AssemblerException($"A '{c}' karakter nem ASCII karakter!"); } return(convertedByte); }
public static bool IsTvcAscii(this char c) { if (HungarianTvcAsciiChars.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); }