开发者

Problem displaying japanese characters on BlackBerry java

Does anyone know the best method to display Japanese/Chinese characters on a BlackBerry screen? I'm retrieving a JSON response from the Google Translate API containing the translated text. I am able to display most languages correctly with UTF-8, but I believe the the Japanese / Chinese characters will not display due to a lack of font / language pack.

I've tried to set the font in my application to a custom Japanese font (.ttf), however this did not work. Perhaps I haven't chosen the correct font? I'm at a dead end, I don't know what to try next.

I know that this is definitely possible, as some translation apps for the BlackBerry will display these languages correctly.

开发者_如何学C

Thanks!


Are you using some variant of this to set the font?:

http://supportforums.blackberry.com/t5/Java-Development/Change-fonts-in-a-BlackBerry-application/ta-p/442921

The closest other thing I could find to an answer is this:

http://supportforums.blackberry.com/t5/Java-Development/Font-Loader-Manager-Utility/m-p/592647#M122351

Update: I looked at the code in your link, and that should work - assuming that you have the font (the *.ttf file) installed in the correct folder on the device (and that the font matches the specific language you're trying to display, since Chinese can't be displayed by a Japanese font).

I don't happen to know where font files are supposed to be on a BlackBerry, but it should be easy to google.


As it turns out, I was able to add/display a custom font. However this did not solve the issue. This whole time, I had been testing on the simulator. Once I tried running the application on the device, the Japanese problems displayed without a problem.

Thanks for your help!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜