Questions tagged [chinese-locale]

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

398 questions
3
votes
1 answer

how to use chinese address get geocoding by ggmap

I have some Chinese addresses to get geocode. I'm pretty sure once it worked by codes like this geocode("黎明侨村",source = "google") but somehow now it doesn't work at more, which throws error…
VincentLin
  • 331
  • 2
  • 12
3
votes
0 answers

Print Chinese character in Python2 or Python3

Recently I've been studying Python, there is some differences between Py2 and Py3, and it's hard to understand them for new babies. The shebang in the head is #!/usr/bin/env python #-*- coding:utf-8 -*- And when I want to print out the Chinese…
Ethan
  • 53
  • 2
  • 10
3
votes
0 answers

Apache FOP using Chinese bold fonts

Has anybody been using chinese bold fonts successfully in PDFs generated using Apache FOP? I tried the Windows-supplied font mingliub.ttc, "MingLiU-ExtB", but it won't render (displays ###). The normal font mingliu.ttc, "MingLiU" works perfectly,…
jfx
  • 355
  • 1
  • 7
3
votes
2 answers

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 special SPACE manually, I decide to code a simple…
Sheldon
  • 519
  • 8
  • 20
3
votes
0 answers

What is the max length for an Android app title in Chinese?

I know that the max. character length for an application title in Google Play Store is 30 characters, see here and here. However, how does this apply to languages that use double-byte characters, like Chinese? Would that be 30 characters as well, or…
Ellie
  • 31
  • 2
3
votes
1 answer

call python scripts from php encoding error for chinese params

i call python script from my php,this is a demo when i pass english params like "abcdxx", it's fine when i pass chinese params like "天河"(even) the return is "天河" when i pass chinese params like "天河区"(odd),the return is "天河åŒ?" my php…
user2538840
  • 47
  • 1
  • 1
  • 8
3
votes
1 answer

How to cut off multi-byte string (English word and Chinese character) in PHP?

I have this function works not quite well in PHP 5.2.0, this function cut string into desired length : function neat_trim($str, $n, $delim='...') { $len = strlen($str); if ($len > $n) { preg_match('/(.{' . $n . '}.*?)\b/', $str,…
Seto
  • 1,234
  • 1
  • 17
  • 33
3
votes
2 answers

Is there a separate Java locale for Mandarin and Cantonese?

I'm trying to use the JDK to get the names of different languages translated into other languages. For example: new Locale("en", "US").getDisplayLanguage(new Locale("en", "US")); // English new Locale("en", "US").getDisplayLanguage(new Locale("fr",…
Adam
  • 43,763
  • 16
  • 104
  • 144
3
votes
1 answer

Sorting chinese names in PHP

I have a array, each item contains a first and a last name: $input = [ [ 'firstName' => 'foo', 'lastName' => 'bar', ] ]; For most users they are mostly in the latin alphabet, but some are written in Chinese. How would I sort this list…
Evert
  • 93,428
  • 18
  • 118
  • 189
3
votes
1 answer

Using The Stanford Parser in Python on Chinese text not working

I tried this code, but it didn't work: # -*- coding:utf-8 -*- from nltk.parse import stanford s = '你好'.decode('utf-8') print s parser =…
Kevin Zhao
  • 2,113
  • 2
  • 14
  • 18
3
votes
1 answer

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 Chinese character under Big-5 encoding? UPDATE Here is…
Divyansh Goenka
  • 997
  • 2
  • 12
  • 35
3
votes
1 answer

How to match Chinese word in Ruby?

I want to match Chinese word in a string, but it failed irb(main):016:0> "身高455478".scan(/\p{Han}/) SyntaxError: (irb):16: invalid character property name {Han}: /\p{Han}/ from C:/Program Files/Ruby-2.1.0/bin/irb.bat:18:in `
' What's wrong…
bluexuemei
  • 233
  • 3
  • 12
3
votes
2 answers

StringBuffer class and Chinese character encoding

I have written a method to return a string containing Chinese characters. public printChineseMenu(){ StringBuffer buffer; buffer.append(chinese string returned from DB); //chinese characters appear in SQL System.out.println(buffer); …
bouncingHippo
  • 5,940
  • 21
  • 67
  • 107
3
votes
1 answer

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 characters? I have googled and found the japanese…
Kim Stacks
  • 10,202
  • 35
  • 151
  • 282
3
votes
1 answer

First chinese char automatically moves to end of string after double space

At the moment I'm translating the software to chinese. I have a problem with the input of chinese characters (the symbols). When I add chinese words, the first character moves to the end of the string. Example words: wo yao guilin | Chinese…