GB 2312 (now GB/T 2312-1980) is a character set for Chinese characters, normally encoded as EUC-CN. Officially superseded by GBK and GB18030 (which include additional characters), it remains in widespread use.
Questions tagged [gb2312]
53 questions
10
votes
5 answers
Convert GB2312 to UTF-8
I have a text file that contains localized language strings that is currently encoded in GB2312 (simplified Chinese), but all of my other language files are in UTF-8. I am finding it very difficult to work with this file, as none of my text editors…

Jon Tackabury
- 47,710
- 52
- 130
- 168
5
votes
1 answer
This character - ㎜ - raises a UnicodeEncodeError
I am using a Python script to convert files from gb2312 to utf-8. This character messes everything: ㎜ (it is one symbol, not "mm").
text = '㎜'
text.encode(encoding='gb2312')
raises this error:
UnicodeEncodeError: 'gb2312' codec can't encode…

Qiao
- 16,565
- 29
- 90
- 117
4
votes
1 answer
Java bug? Can't read GB2312 file with Scanner directly
I have a file in GB3212 encoding (Chinese). File is downloaded from here http://lingua.mtsu.edu/chinese-computing/statistics/char/list.php?Which=MO as is with wget under Windows and stored into ModernChineseCharacterFrequencyList.html filename.
The…

Dims
- 47,675
- 117
- 331
- 600
3
votes
1 answer
How to change GB-2312 encoding to UTF-8
I use nsurlsession and received nsdata with GB-2312 encoding. How can I change the encoding from GB-2312 to UTF-8.
I tried this code
let enc = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000)
var result = NSString(data:…

Lilo Lu
- 163
- 2
- 8
2
votes
1 answer
Converting GB2312 Encoded MIME to Readable String
I apologize in advance for sounding ignorant when I ask this question, but I'm not very good at conceptualizing the concept of encoding and decoding data.
As an example, I have access to a MIME encoded text with the following…

RedMageKnight
- 187
- 2
- 12
2
votes
1 answer
Encoding GBK2312 Condundrum
I am an amateur coder and I have a small problem.
My goal is to have one text input with two buttons.
The first button uses a bit of
Javascript called SundayMorning to
translate the text (to Chinese)
The second button submits the text to a
URL.…

user792271
- 21
- 1
2
votes
0 answers
iOS: What's the best way to detect a file's encoding
In some cases, I really need to know a file's encoding while reading the file. Sometimes we can do as Apple's String Programming Guide suggest :
Reading data with an unknown encoding
If you find yourself with text of unknown encoding, it is best…

keywind
- 1,135
- 14
- 24
2
votes
1 answer
iconv Detected an illegal character in input string
I don't know chinese language. But I faced problem using these codes:
iconv('UTF-8', 'GB2312', '在世界自由软件日给中国自由软件爱好者的视');
runs ok with no problem.
and this one:
iconv('UTF-8', 'GB2312', '冠軍集團安心居台北旗艦總店開幕酒會暨記者會');
which causes error:
Message: iconv():…

monjevin
- 177
- 2
- 3
- 11
2
votes
2 answers
decode json encoded as GB2312
Via a GET request, I pull json from the Google geocode API:
import urllib, urllib2
url = "http://maps.googleapis.com/maps/api/geocode/json"
params = {'address': 'ivory coast', 'sensor': 'false'}
request = urllib2.Request(url + "?" +…

BioGeek
- 21,897
- 23
- 83
- 145
2
votes
1 answer
Displaying special characters with Chinese Locale in c
I have a requirement to adapt an existing, non-unicode, c project to display Chinese characters. As there is a short deadline, and I'm new(ish) to C and encoding I've gone down the route of changing the sytem locale to Simplified Chinese PRC in…

Rob
- 21
- 1
2
votes
1 answer
How to write copyright symbol to a file with GB2312 encoding?
I want to write the copyright symbol to the footer of a pdf file. The octal code \251 only works when the encoding of the file is latin. (english language)
when the output pdf is in chinese, japanese, korean language. The symbol is printed totally…

azi
- 21
- 1
1
vote
1 answer
Build a token for Simplified Chinese Identifiers
I'm trying to build a token for Simplified Chinese Identifiers.
Simplified Chinese Identifiers are defined in the specification as follows:
simplified-Chinese-identifier = first-sChinese-identifier-character…

SoftTimur
- 5,630
- 38
- 140
- 292
1
vote
1 answer
Java XML Encoding for GB2312 with ISO-8859-1 on the declaration
I am working to migrate my code that creates XML from Java 1.4 to 1.8. From the old java code, it encodes the xml file into GB2312 and the XML declaraction is this with correct chinese characters. But when…

Glen
- 11
- 2
1
vote
0 answers
why iconv can not convert a character
I got this error. Do anybody know what is wrong? Thanks.
$ wget -qO- http://yjs.cd120.com/daoshi-2.html| iconv -f gb2312 -t utf-8 > /dev/null
iconv: (stdin):430:173: cannot convert

user1424739
- 11,937
- 17
- 63
- 152
1
vote
2 answers
=?gb2312 encoding issue and recomendation
I am writing java code to decode the incoming email traffic encoded using =?gb2312? and Not always MimeUtility.decodeText() succeeds with the chinese characters.
I see few recomendations to use =?gb18030? instead and it works for the set i tried. …

Sathish Kumar
- 313
- 2
- 15