0

I have a CSV file in Traditional Chinese and it is coded as ANSI. The file can be read correctly on Traditional Chinese Windows versions. But when I open it on Windows 10 English version, it looks like this:

enter image description here

Is there a way to convert ANSI text to Unicode correctly in C# without installing language pack onto the English Windows version?

SuperBerry
  • 1,193
  • 1
  • 12
  • 28
  • 1
    It would be better that you could post this at another forum like `SuperUser` – Eldar Apr 17 '21 at 09:29
  • How are you display the results? The issue is not with the c# code. The viewer you are using is not support the font. If results is being displayed in VS than you just need to set VS property to view with different language. – jdweng Apr 17 '21 at 09:42
  • So-called `ANSI` is a Microsoft misnomer. Please use [edit] button to share output from `REG QUERY "HKLM\SYSTEM\CurrentControlSet\Control\Nls\CodePage" -v *CP` on *Traditional **Chinese** Windows version*. – JosefZ Apr 17 '21 at 11:31
  • Try loading the file in an Notepad++ and selecting Encoding->Characters Sets->Chinese->Big5(Traditional). Does it display correctly? – Mark Tolonen Apr 17 '21 at 18:20
  • Is there a way to do that in C# to convert? – SuperBerry Apr 18 '21 at 02:19
  • First step is to determine what encoding the text is actually in. Once you've done that, just use a `StreamReader` configured with an appropriate `Encoding` instance to match the encoding of the text. See duplicate. – Peter Duniho Apr 18 '21 at 02:54

0 Answers0