Extended ASCII in C#

后端 未结 1 484
深忆病人
深忆病人 2020-12-18 13:25

I want to store some of the extended ascii characters into a dictionary for lookup but having little issue with getting the conversion.

The current method I have to

相关标签:
1条回答
  • 2020-12-18 14:09

    I assume your "Extended ASCII" is actually code page 437:

    Encoding cp437 = Encoding.GetEncoding(437);
    byte[] source = new byte[1];
    for (byte i = 0x20; i < 0xFE; i++)
    {
        source[0] = i;
        AnsiLookup.Add(i, cp437.GetString(source));
    }
    

    Beware that this code page is not natively supported by the .NET Framework, so it might not be available on all systems.

    0 讨论(0)
提交回复
热议问题