Strings.Asc('š') = 154
Strings.AscW('š') = 353
I'm porting an old solution to netstandard from netframework. Strings.Asc doesn't existing in the visual basic package, the only option being Strings.AscW. On the surface they appear to be a functionally the same, however they return different solutions
Why? I'd like the same result (154) from Strings.AscW, is there a similar solution that will work on .netstandard?
I’m guessing you’ll have to go the long route via an explicit encoding, and constructing a char
array, since there does not seem to be a method for decoding individual char
s.
int result = Encoding.GetEncoding(1252).GetBytes(new char[] {'š'})[0];