GBK is an extension of the GB2312 character set for simplified Chinese characters, used in the People's Republic of China.
Questions tagged [gbk]
47 questions
0
votes
0 answers
pip cannot install or upgrade, with UnicodeDecodeError reported
I am using anaconda Powershell Prompt in Win10. UnicodeDecodeError was reported when installing package with pip (version: 21.2.4). I found this error would reported with the kernel Python 3.6.7 and Python 3.9.7.Both the installation and the upgrade…

yonsen liu
- 1
- 1
0
votes
0 answers
Wrong charset?Java program get the damaged string from args[0]
I ran my java program in Windows 10 (defalt charset:Big5).
Then I got the garbage string from args[0].
I found that it is hard to convert damaged string(args[0]) to readable string by using any kind of charset.
IDE(UTF-8)-->JVM(UTF-8 damaged…
user8514159
0
votes
0 answers
illegal multibyte sequence in Pycharm while using exec(open('file.py').read())
I'm using PyCharm to run code:
exec(open('file.py').read())
while running some file I got:
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa7 in position 2655: illegal multibyte sequence
Any friend can help?

William
- 3,724
- 9
- 43
- 76
0
votes
1 answer
Inno Setup: recording/recover file path in UTF8
We are using Inno Setup (unicode version) to create resource package (or "samples") for our product. The program part of our product knows the location of the samples by a file that is written by samples installer. At current, it is implemented in…

jiandingzhe
- 1,881
- 15
- 35
0
votes
1 answer
Strange Characters after downloading Chinese table from html
I am using MAC OS X 10.12 system.
I downloaded a table from http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/2011/51/06/81/510681114.html
.
The table was encoded with GB2312, however, I used GBK to save the table. The main part of the code is like…

Yijiao Liu
- 184
- 12
0
votes
0 answers
PySpark read GBK HDFS contain Chinese characters
I have many big HDFS files encoded in GBK, but these files contain special characters including Chinese etc. These Chinese strings would be shown or saved into a file. How can I handle the problem?
PySpark supports UTF-8 reader only.
Spark version:…

MartinGau
- 1
- 1
0
votes
1 answer
How to encode parameter as gbk instead of utf-8 with cURL or python requests?
I have a strange API, it just accept gbk parameters, I capture the data in Windows IE browser, show data with this command:
$ cat 12_Request.txt| iconv -f GBK -t UTF-8
GET…

roger
- 9,063
- 20
- 72
- 119
0
votes
0 answers
In sql, is there a function to convert hexadecimal in GBK?
I have this .php script to receive username and password from another page:
$req2 = $bdd->prepare('SELECT * FROM users WHERE login="'.$_POST['val1'].'"and password="'.$_POST['val2'].'"');
$req2 -> execute();
My database accepts GBK language, but…

mric750
- 183
- 8
0
votes
1 answer
scp file to linux auto convert filename to utf8
As we all know, Windows use ANSII to encode file name in file system, but Linux use UTF-8 by default. When I use SCP or FTP/SFTP to transfer files from windows to Linux, the transferred files will still encoded by ANSII. I want my Linux use UTF-8…

cck
- 703
- 6
- 11
0
votes
1 answer
Recovering the distorted Chinese format and identifying the original Chinese encoding
I am working with a file that has read Chinese Wikipedia content and apparently somehow has been converted to UTF-8
but not correct.
import re,urllib
st=u'1492: Conquest ▒�¢â▒��¬â▒�▒¹of Paradise'
st1= urllib.unquote(st).encode('UTF-8')
st2=…

user1848018
- 1,086
- 1
- 14
- 33
0
votes
3 answers
How to compare unicode and str in Python
My code:
a = '汉'
b = u'汉'
These two are the same Chinese character. But obviously, a == b is False. How do I fix this? Note, I can't convert a to utf-8 because I have no access to the code. I need to convert b to the encoding that a is using.
So,…

Yuhuan Jiang
- 2,616
- 2
- 19
- 21
0
votes
0 answers
Can python process multiple Chinese encodings in one string?
Input string has chinese words, some encoded by UTF8, some by GB2312. Could python process such string with multiple encodings?

David Wang
- 61
- 2
0
votes
2 answers
How to compare non-English(Chinese) Characters in python program?
In one of my python program(python 2.7), I need to process some chinese characters:
I have a file A.txt, it has two columns: "name" and "score", the "name" column can be valued some chinese strings, and score is an int number values between 1 and…

Y.L.
- 1,274
- 6
- 23
- 39
0
votes
2 answers
How do I convert GBK to UTF8 with pure JavaScript?
I want to load some text from other site which the content is GBK encoded, but my site is UTF8.
Is there anyway by which I can convert these GBK text into UTF8 for display?
For some reasons I can only use JavaScript for this.

WoooHaaaa
- 19,732
- 32
- 90
- 138
-1
votes
1 answer
How to write windows-936 to log When wchar_t in the code by boost.log
Follow the boost.log
, the sample.log was parsed as utf8.
Now I want to write at windows.936, but the code below is useless.
void init_logging() {
...
std::string strCodePage = boost::locale::util::get_system_locale();//strCodePage is…

sculida
- 11
- 3