コードページ 850 でエンコードされたテキスト ファイルがあります。このファイルを次のように読みます。
using (var reader = new StreamReader(filePath, Encoding.GetEncoding(850)))
{
string line;
while ((line = reader.ReadLine()) != null)
{
//...
}
//...
}
line
ここで、コードページ 850 にあるその文字のゼロベースのインデックスの上のループ内の文字列内のすべての文字が必要です。次のようなものです。
for (int i = 0; i < line.Length; i++)
{
int indexInCodepage850 = GetIndexInCodepage850(line[i]); // ?
//...
}
これは可能で、どのようint GetIndexInCodepage850(char c)
に見えるでしょうか?