1
Answer

Problem in Reading Binary File

Ask a question
Sameer

Sameer

15y
2.7k
1

Hello all,

I'm trying to read Binary file that contains English as well as some Japanese string like (D001-English &  ????- Japanese).

I'm using following code to do this:

"symbolName = Encoding.Unicode.GetString(binaryReader.ReadBytes(stringLength));"

I can successfully read Japanese string but for English strings, same code gives some garbage value.

If I used

"SymbolName = new string(binaryReader.ReadChars(stringLength));"

it will give me English string correctly, but not Japanese strings.

So, how to read this type of binary file?

Thanks.

Sam


Answers (1)