profile picture

3 pages tagged with "unicode"

Sorting Chinese characters

December 28, 2013
<p>Recently we decided to localize country selection list at work and there was some confusion about how to sort Chinese characters. I asked my wife and she told me that sorting by pinyin is seems most reasonable to her. So here's how to do it in Perl read more

More about UTF-8

August 02, 2008
Now suppose you want to rid string of malformed utf-8 characters. Here is an example that checks an utf-8 string and replaces all malformed characters with '?'. The same idea as in the previous post. Note, that it checks only encoding, it is possible that encoding is correct, but the symbol doesn't … read more

How to truncate UTF-8 string

July 16, 2008
<p>Suppose you need to put UTF-8 string into a fixed length buffer. Actually I was in need to do this. Problem is that the last symbol may be incomplete, so here is the example how to do this read more