Pascal
Pascal

Reputation: 1093

How to convert UNICODE / UTF-8 to GB2312 in C

I'm searching for a method to convert a two Byte UNICODE or a variable (1-3 Byte) UTF-8 string to Chinese Simplified (GB2312). I found a lot of methods for php, Java, C# and Windows but nothing for standard "C".

Right now, my best solution is to translate this JavaScript example: https://gist.github.com/19317362/a1d8e40bfb6587463d4d

Thanks in advance!

Upvotes: 0

Views: 1407

Answers (1)

Pascal
Pascal

Reputation: 1093

As Remy Lebeau mentioned, I used the C-compatible library iconv.

Upvotes: 0

Related Questions