Questions tagged [chinese-locale]

Questions related to specific aspects of machine-processing Chinese language, or to code that is executed under Chinese localization settings.

chinese-locale
Filter by
Sorted by
Tagged with
518 votes
20 answers
1.3m views

How to fix: "UnicodeDecodeError: 'ascii' codec can't decode byte"

as3:~/ngokevin-site# nano content/blog/20140114_test-chinese.mkd as3:~/ngokevin-site# wok Traceback (most recent call last): File "/usr/local/bin/wok", line 4, in Engine() File "...
fisherman's user avatar
  • 10.8k
9 votes
1 answer
10k views

Apache FOP Displaying ### with SimSun

I am maintaining a program which uses the Apache FOP for printing PDF documents. There have been a couple complaints about the Chinese characters coming up as "####". I have found an ...
user3826668's user avatar
4 votes
5 answers
13k views

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-...
joe's user avatar
  • 177
6 votes
3 answers
18k views

How to read an UTF-8 encoded file containing Chinese characters and output them correctly on console?

I am writing a web crawler to fetch some Chinese web files. The fetched files are encoded in utf-8. And I need to read those file to do some parse, such as extracting the URLs and Chinese Characters. ...
Bruce Yang's user avatar
6 votes
5 answers
22k views

How to display Chinese characters inside a pandas dataframe?

I can read a csv file in which there is a column containing Chinese characters (other columns are English and numbers). However, Chinese characters don't display correctly. see photo below I loaded ...
Daniel's user avatar
  • 1,448
106 votes
4 answers
142k views

Language codes for simplified Chinese and traditional Chinese?

We are creating multi-language subsites on our website. I would like to use the 2-letter language codes. Spanish and French are easy. They will get URLs like: mydomain.com/es mydomain.com/fr ...
jeph perro's user avatar
  • 6,352
21 votes
3 answers
6k views

ReportLab: working with Chinese/Unicode characters

TL;DR: Is there some way of telling ReportLab to use a specific font, and fallback to another if glyphs for some characters are missing? Alternatively, Do you know of a condensed TrueType font which ...
ztorage's user avatar
  • 323
10 votes
5 answers
8k views

How can I check if a string contains Chinese in Swift?

I want to know that how can I check if a string contains Chinese in Swift? For example, I want to check if there's Chinese inside: var myString = "Hi! 大家好!It's contains Chinese!" Thanks!
He Yifei 何一非's user avatar
8 votes
4 answers
10k views

How to use mPDF for Chinese Language

I am using mPDF to save form input data to PDF. For English, it is working fine. Anyone can use this code to save HTML Form data to PDF. Issue: In order to fulfill my project requirement I need to ...
ZiaUllahZia's user avatar
  • 1,122
6 votes
2 answers
4k views

What is proper way to test if the input is Korean or Chinese using JavaScript?

My application was relying on this function to test if a string is Korean or not : const isKoreanWord = (input) => { const match = input.match(/[\u3131-\uD79D]/g); return match ? match.length =...
vdegenne's user avatar
  • 12.8k
5 votes
1 answer
2k views

How to get the script from a Locale object on Android?

From what I see the Android Locale class doesn't mention anything about the script, only the language, country and variant. Whereas the Java SE Locale class mentions language, country, script, ...
Alex Bitek's user avatar
  • 6,549
4 votes
1 answer
11k views

DomPDF generation for chinese characters

I am trying to generate a PDF that will contain Chinese characters using dompdf. Here is my code: require('dompdf/dompdf_config.inc.php'); $dompdf = new DOMPDF(); mb_internal_encoding('UTF-8'); def("...
Alexandru Cioroianu's user avatar
4 votes
2 answers
4k views

Using sed, how can a regular expression match Chinese characters?

I decided to post a question, after spending quite some time and still not figuring out the problem. Also read a bunch of seemingly related posts, none really fit my simple (?) problem. So I have a ...
sweetnsour's user avatar
2 votes
2 answers
389 views

Outputting dates in non-ASCII characters with PHP

I'm trying to output the date in Traditional Chinese. I have the date as a Unix timestamp, ( example: "1467244800" ). I am doing the following: <?php setlocale (LC_TIME, "zh_TW"); echo strftime("...
Neil Hillman's user avatar
0 votes
2 answers
14k views

IText - Generating PDF with Chinese characters (Chinese Simplified)

I am using iText to generate some PDFs, these pdfs have some Chinese characters (Simplified Chinese - GB2312), however I am unable to generate a pdf with these characters. Anyone could tell me where ...
Estevão Jordão's user avatar
10 votes
3 answers
4k views

libgdx draw chinese characters

I like to print Chinese text in my application. 1.When I try this, the screen will be empty. There is no error at the console. Create method: FreeTypeFontGenerator gen = new FreeTypeFontGenerator(...
Michael S's user avatar
  • 759
7 votes
1 answer
4k views

How to use Google's Text-to-Speech service for Chinese characters on Android?

I'm trying to pull an audio file from google's text-to-speech function. Basically, you toss in the link and then concat whatever you want to be spoken at the end of it. I've gotten the below code to ...
Matter Cat's user avatar
  • 1,568
5 votes
1 answer
10k views

Chinese collation for MS SQL

I found in our production DB for Asia market weird behavior. Where condition is not working as one would expect in case of Chinese letters. create table #Temp (TextContent nvarchar(20), ...
Jaroslav Kubacek's user avatar
5 votes
2 answers
996 views

Different representation of unicode code points in Japanese and chinese

I am trying to display the glyph corresponding to unicode 0x95E8. This codepoint is basically of CJK block (chinese, Japanese, Korean). I am struggling to know if the glyph representation of this ...
Yogesh's user avatar
  • 565
4 votes
1 answer
5k views

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, ...
fallincode's user avatar
4 votes
1 answer
405 views

Viewing Chinese/Korean/Lunar birthday on org-agenda?

I have a few people around me who use Lunar Calendar instead of Gregorian one, so my current set up: *** Birthdays :PROPERTIES: :CATEGORY: Birthday :END: **** NAME <1980-09-09 Thu +1y> fails ...
THIS USER NEEDS HELP's user avatar
3 votes
2 answers
6k views

Eliminate the "\u3000" error in java

When I try to compile a java file, the compiler said "illegal character \u3000", after searching, I find it is CJK Unified Ideographs Chinese Korean and Japanese's SPACE. Instead of deleting the ...
Sheldon's user avatar
  • 541
3 votes
1 answer
3k views

create URL slugs for chinese characters. Using PHP

My users sometimes use chinese characters for the title of their input. My slugs are in the format of /stories/:id-:name where an example could be /stories/1-i-love-php. How do I allow chinese ...
Kim Stacks's user avatar
  • 10.5k
3 votes
1 answer
1k views

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(...
srgsanky's user avatar
  • 713
3 votes
1 answer
3k views

Check if a character is Traditional Chinese in Big-5 (Java)?

I have a thermal printer, which supports only Traditional Chinese characters other than Latin. Is there any way to check, that given a CJK character in Unicode, whether it is a valid Traditional ...
Divyansh Goenka's user avatar
2 votes
3 answers
453 views

MySQL 5.7 miss matching against two-Chinese-character words

Table tb: title keywords 企业贷款,该如何看懂银行流水 出口退税,贷款,现金流量表,利润表 最高人民法院关于审理民间 企业贷款,合同法,贷款 中国宏观经济数据点评 企业贷款,贷款 ngram_token_size=2 FULLTEXT INDEX `keywords_title`(`...
AarioAi's user avatar
  • 585
2 votes
1 answer
2k views

Showing navigator.geolocation.getCurrentPosition in Baidu Maps

We know that due to the infamous China GPS offset problem, GPS (WSG-84) map coordinates don't correspond exactly to the coordinate system that state-approved Chinese maps use (GCJ-02). The question ...
Dan Dascalescu's user avatar
2 votes
1 answer
3k views

How to detect Chinese Character in MySQL?

I need to calculate the number of Chinese in a list of columns. For Example, if "北京实业" occur, this is four characters in Chinese but I only count once since it occurs in the column. Is there any ...
Sheldon's user avatar
  • 541
1 vote
2 answers
2k views

parsing chinese characters in java showing weird behaviour

I am having a csv file which has some fields having chinese character strings. Unfortunately i dont know what is encoding of this input csv file. I am trying to read this input csv and using selective ...
adityag's user avatar
  • 603
1 vote
2 answers
1k views

Input Chinese characters not correctly echoed in ESS

I had this weird encoding issue for my Emacs and R environment. Display of Chinese characters are all good with my .Rprofile setting Sys.setlocale("LC_ALL","zh_CN.utf-8"); except the echo of input ...
lcn's user avatar
  • 2,259
1 vote
2 answers
8k views

.NET Chinese CultureInfo "zh" does not exist?

I'm using .NET 3.5 and running the following code: var culture = new CultureInfo("zh"); // Throws ArgumentException I got the string "zh" from an xml:lang attribute. I don't understand why an ...
Richie's user avatar
  • 41
1 vote
0 answers
626 views

How to display chinese characters in PDF using ITextSharp in c#?

I want to display one word of chinese characters in PDF along with english characters. Currently chinese characters are not getting displayed in PDF.I have used itextsharp to generate pdf with ...
vinu natesh's user avatar
0 votes
1 answer
823 views

Cannot generate PDF for some specific simplified chinese characters via TCPDF

I have an existing program (codes) to generate PDF file via TCPDF. It works fine even contain non-English characters in most cases, but now, when the content has either two simplified Chinese ...
NelsonC's user avatar
  • 11
0 votes
1 answer
459 views

How can I add support for Chinese keyboard with UITextView on iOS 7?

How can I add support for Chinese keyboard with UITextView on iOS 7? Currently I'm using the following code. But it works correctly only for standard-sized keyboards. It resizes UITextView only for ...
Dmitry's user avatar
  • 14.5k
0 votes
2 answers
5k views

How to read Chinese files?

I'm stuck with all this confusing encoding stuff. I have a file containing Chinese subs. I actually believe it is UTF-8 because using this in Notepad++ gives me a very good result. If I set gb2312 the ...
JasonTS's user avatar
  • 2,559
0 votes
1 answer
504 views

NSSortDescriptor in Chinese... how?

I am adding Chinese support to my application. I have this line that sorts english and other languages NSSortDescriptor *sortByItem = [NSSortDescriptor sortDescriptorWithKey:@"countryName" ...
Duck's user avatar
  • 35.5k