This C# code would return an unexpected result:
char x = Convert.ToChar(0xff); Console.WriteLine( Char.IsLetterOrDigit(x)); It prints True were I was hoping for a False. I assume this is because IsLetterOrDigit is expecting a Unicode character as input versus the extended ascii value I convert from.
How could I make this work? I am reading a continuous binary string from a serial port where problematic characters needs to be removed for reporting.
ÿ, which absolutely is a letter, according the the unicode specification; so: why are you expecting it not to be? what code-point were you expecting? note that "extended ascii" is ambiguous; you need to talk about a specific code-page or encoding for that to make sense