Showing posts with label chinese. Show all posts
Showing posts with label chinese. Show all posts

Friday, November 25, 2011

Removing Chinese or non ASCII Characters from the end of a string in MySQL

Step 1. First make sure the string has Chinese or non ASCII characters in it:

select asciiname from table1
where asciiname regexp(concat('[',char(128),'-',char(255),']'));


Step 2. If the Chinese name is definitely at the end of your field, you just need to trim the last occurrence of a space in your field. Confirm it is doing the right thing first:

select asciiname, reverse(substring(reverse(asciiname), locate(' ', reverse( asciiname ) )+1))
from table1
where asciiname regexp(concat('[',char(128),'-',char(255),']'));


Step 3. Execute:

update table1
set asciiname = reverse(substring(reverse(asciiname), locate(' ', reverse( asciiname ) )+1))
where asciiname regexp(concat('[',char(128),'-',char(255),']'));




My sources for this were (I am very grateful to):
1. http://stackoverflow.com/questions/461871/find-rows-with-non-ascii-values-in-a-column

2. http://dev.mysql.com/doc/refman/5.1/en/string-functions.html



Saturday, October 02, 2010

Chinese or Unicode Fonts With Adobe Illustrator Not Showing

I had this problem where, after pasting some Chinese characters into illustrator, they were not 'digestible' by the system:




To solve this. I figured out that you need to select a Chinese font before pasting the characters.

I used Hiragino Sans GB.




And it was fine:

Saturday, July 19, 2008

Changing Locale To Chinese On ASUS EeePC

Changing Locale To Chinese (and all the other languages) On ASUS EeePC.


Recently a friend of mine tried changing the locale on his new ASUS Eee PC to Chinese (PRC). No problem, we thought, we changed the locale to "LANG=en_CN.UTF-8" and everything seemed to work.

However, after changing this the extra features on the touchpad such as the zoom, scrolling etc didn't work anymore.

So eventually we tried the steps given on this site to change the locale instead:

http://www.eeeuser.net/?p=8

Alas, it worked! Kudos to this great blog for posting it up.



Wednesday, February 27, 2008

UTF-8 Problem Between Apache and Tomcat via Mod_JK

If the UTF-8, GBK, Chinese or whatever character set it may be, is showing via Tomcat (i.e. accessing from port 8080) but not showing in Apache (via mod_jk) then one step might be to check that the AJP connector has the URIEncoding set too as mod_jk uses that connector rather than the one that might be set on port 8080.

For Example:

<connector port="9011" enablelookups="false" redirectport="8443" protocol="AJP/1.3" uriencoding="UTF-8"></connector>