Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Having trouble with Japanese character "〜" in Android

Tags:

android

I don't know how to read Japanese - I don't know what this character means.

We are using encoding UTF-8 in our XML file and can see all other Japanese characters in our app except for "〜", which shows up as a box. "〜" shows up in Eclipse, tried replacing it with a tilde (~), but the tilde is smaller and looks slightly different (〜 vs ~) in our app.

On Google Translate, it interprets the character as a tilde http://translate.google.com/#ja/en/%E3%80%9C

In Android, we have used 〜 and \u301C but they both show up as boxes.

An example of how the character is used "気分が悪いよ〜!"


My question: This is the only character that's missing for us (we have an American Android phones and changed the language to Japanese). How do we make this character show up?

like image 801
Tei Avatar asked Jan 22 '13 01:01

Tei


1 Answers

The problem is that there are two similar characters in Unicode. First, we have U+301C WAVE DASH, described here, then we have U+FF5E FULLWIDTH TILDE, described here. The first of these is CJK_Symbols block, which appears not to be present in all Unicode fonts, such as on Android. However, the second is in the Half_And_Full_Forms block, which does appear to be present, and a quick test on my Android phone with the standard Japanese IME confirms that U+FF5E FULLWIDTH TILDE is used.

Now, you mention that you are encoding UTF-8 - perhaps there is an error in the conversion tables you are using? I would recommend that you just silently replace all instances of U+301C WAVE DASH with U+FF5E FULLWIDTH TILDE.

UPDATE: You mention your translator - perhaps they are using a Mac, which appears to prefer the U+301C WAVE DASH? Furthermore, here is a WordPress plugin that suggests a few more characters that should be tested, although I suspect that the tilde/wave dash will be the only problem.

like image 145
Ken Y-N Avatar answered Oct 12 '22 08:10

Ken Y-N