Questions related to specific aspects of machine-processing Chinese language, or to code that is executed under Chinese localization settings.
Questions tagged [chinese-locale]
398 questions
4
votes
0 answers
Display characters instead of unicode numbers in PyCharm watch window
The problem I have can be re-produced by pasting this code into PyCharm:
chinese = [u'这', u'是', u'一', u'些', u'中', u'文']
print chinese
When you set a breakpoint at the print line and start debugging, you could see tha the variable chinese in the…

Yuhuan Jiang
- 2,616
- 2
- 19
- 21
4
votes
5 answers
How to display Chinese in matplotlib plot
Here, I have a plot work to do with pandas, like this :
most_active_posts.plot(x = 'title',y = 'active_span',kind = 'barh')
most_active_posts is an object of dataframe with index, I want a simple two-dimensional plot with two columns, one is…

joe
- 177
- 1
- 1
- 11
3
votes
1 answer
What is the typical Chinese language code for the Accept-Language header?
Unfortunately, I have no way to check this personally, so I wanted to ask the community about it.
According to RFC 5646, Chinese can have the following representation: zh-Hans for Simplified Chinese, zh-Hant for Traditional Chinese, or more…

fallincode
- 379
- 4
- 14
3
votes
1 answer
Python convert utf-8 bytes to string
I have difficulties converting those bytes to string:
x =…

Mike Will
- 189
- 15
3
votes
0 answers
How do I display Chinese text properly in R Studio?
I'm Chinese, and deal with Chinese characters frequently. I still can't find a way to properly encode Chinese.
The best way so far is read.csv(file_name, fileEncoding = "UTF8"). But when I list all the files in the wd using dir(), it comes up…

user155624
- 31
- 3
3
votes
0 answers
Why when I use select statement like "select * from table_name where character='⺎' " then return '尢','⼪','⺎' and '⺐'
Mysql query returns mismatched records, such as the query field character='兀' but matches out, 尢, ⺎, ⺐?
I update my mysql from 5.7 to 8.0,in 5.7,this problem is more common
drop database if exists `chinese_sort`;
create database `chinese_sort`…

StringTek
- 31
- 2
3
votes
2 answers
Using AVSpeechSynthesizer for Chinese pinyin
In my Swift program, I use AVSpeechSynthesizer to pronounce Chinese characters. This is my method:
static var synth = AVSpeechSynthesizer()
static func speak(string: String)
{
let utterance = AVSpeechUtterance(string: string)
…

Jonathan Rachlin
- 361
- 3
- 16
3
votes
1 answer
Invalid unicode character causing MySQL string error
I need to add a record to our MySQL database (via Omeka) that includes an invalid unicode character (this one)
The error message I get via Omeka is:
Mysqli statement execute error : Incorrect string value: '\xF0\xAA\xA8\xA7\xE7\x94...' for column…

Another_Omeka_User
- 51
- 8
3
votes
1 answer
Display chinese characters in python console
I know related questions have been asked but my case is a bit specific because I run my code in a Docker container, and I haven't been able to make other solutions work.
I'm using python 2.7 to translate an english text to chinese (and other…

Sulli
- 763
- 1
- 11
- 33
3
votes
0 answers
How to split a Chinese paragraph into sentences in Python?
Since Chinese is different from English, so how we can split a Chinese paragraph into sentences (in Python)? A Chinese paragraph sample is given as
我是中文段落,如何为我分句呢?我的宗旨是“先谷歌搜索,再来问问题”,我已经搜索了,但是没找到好的答案。
To my best knowledge,
from nltk import…

Ian
- 160
- 11
3
votes
0 answers
Chrome PDF viewer doesn't show chinese characters
In our application we have a section where you can open a PDF through the browser. It opens without a problem in all the countries but China. It just doesn't display the text with chinese characters, but if I download the PDF and I open it with…

David
- 161
- 1
- 9
3
votes
0 answers
Pinyin text-to-speech
Any idea how to use Android text-to-speech API for Pinyin (with tones)? I can set Locale.China for Simplified Chinese, but how to input Pinyin?

Demiurg
- 1,597
- 8
- 26
- 40
3
votes
0 answers
'translateChar' must be called on a CHARSXP
I am trying to export data to a csv-file. My dataframe consist mainly of strings in Chinese. I work on a Jupyter notebook with a IRkernel on a Win10 computer with Swedish as the default language.
The locale is set to be…

Xueping Sun
- 31
- 3
3
votes
1 answer
Chinese Character Encoding in R Studio
I am currently working with large CSVs of Chinese medical records in R Studio but am having trouble processing Han Chinese characters. In particular, I am able to "view" Chinese characters in table form (i.e. using R Studio's built-in data viewer…

charles
- 31
- 5
3
votes
1 answer
BreakIterator not working correctly with Chinese text
I used BreakIterator.getWordInstance to split a Chinese text into words. Here is my example
import java.text.BreakIterator;
import java.util.Locale;
public class Sample {
public static void main(String[] args) {
String stringToExamine =…

srgsanky
- 671
- 1
- 11
- 16