erotsppa
erotsppa

Reputation: 15021

How do I convert the following chinese characters?

I was given some text to show in my program. However I opened it in textedit and the text is not readable. I was told that it's chinese characters. What do I need to do to make it readable?

•—§WƸ¨v∞”¡`∑|™∫•|¶Ï•N™Ì

I'm using OSX to open this file. File is in text format. This above is a sample line.

Upvotes: 0

Views: 504

Answers (1)

bobince
bobince

Reputation: 536369

•—§WƸ¨v∞”¡`∑|™∫•|¶Ï•N™Ì

That's the sort of thing you get if you read a text file as being in the MacRoman encoding when it actually contains something else.

Probably it's just your text editor that has guessed MacRoman because it had nothing else to go on. It's conceivable that the text file is mangled and saved with those characters in UTF-something, but much more likely the bytes of your file are:

A5 D1 A4 57 AE FC AC 76 B0 D3 C1 60 B7 7C AA BA A5 7C A6 EC A5 4E AA ED

And those bytes look to me a lot like Big-5. Decoding them with the Big-5 charset gets you:

由上海洋商總會的四位代表

Which looks pretty likely.

So to read the file take the bytes and decode them using the Big-5 charset. Quite how you do that depends on what language you're using.

Upvotes: 2

Related Questions