Japanese texts can't display proper on a device (newText bug?)

Hi ansca team!
I’m stuck in a trouble.

When I use Japanese 2-byte characters on display.newText on the simulator, it is displayed proper.
But on the device, the last character disappeared.

I found the reason.
The problem occur by “size” argument.

Here is the code.

for i=1, 16 do  
 local myText = display.newText( "??????????", 20, 20+(10+i)\*i, native.systemFont, 10+i)  
end  

("???" means “Cerberus came into the world” :slight_smile:

Here is the picture I took on the simulator.
(The latest corona SDK version: 2011.12.08)
http://s8.postimage.org/o0fide579/i_Phone.png

And, here is the picture I took on the device.
(iPod touch 4th gen 4.35)
http://s8.postimage.org/iaz9t2z11/device.png

As you can see, some size will be displayed very fine.
But some size cannot.

Is this a bug?
If this is not a bug, please tell me the solution. [import]uid: 98774 topic_id: 18968 reply_id: 318968[/import]

I tried Chinese characters as well.
The same problem happened.

Here is the sentence I tried on that code.
“???” (this means hello :slight_smile:

I didn’t try other languages though.
Japanese and Chinese character have the same problem at the display.newText on a real-device.

(display.newRetinaText also have the same problem) [import]uid: 98774 topic_id: 18968 reply_id: 73067[/import]

Hey guys, have either of you submitted a bug report? Bug #?

Peach :slight_smile: [import]uid: 52491 topic_id: 18968 reply_id: 73178[/import]

I was just struggling with this a few hours ago!
I noticed that this can happen with any CJK text (Chinese/Japanese/Korean)

From my initial experiments I only saw this on my iOS 4.3.5 device with odd-numbered font sizes. devices with iOS 3.1.3, 5.0.1 and 5.1 beta behaved with my test texts.

However I haven’t tried your simple example above yet. I will do that and update this post once done.
Don’t worry, I’ll also post a bug report with my findings :slight_smile:

EDIT:
Reported as bug: Case 10565
I’ve now done more detailed testing with font sizes ranging from 11-26 with the following results:

iOS 3.1.3 and iOS 4.3.5
Identical output: font sizes 11, 15, 18, 19, 20, 21, 22, 23 have a missing last character.

iOS 5.0.1 and 5.1 beta
Displays all characters.

Android 2.2:
(Galaxy Player) Displays all characters. [import]uid: 70847 topic_id: 18968 reply_id: 73190[/import]

@peach pellen
No, not yet.

@ingemar
wow, Thanks a lot!
Your report is very useful for all corona users who use Chinese, Korean, and Japanese!
Seeing your report, before the iOS 5.0.1 confront this problem…
Hmm… until ansca team fix this bug, I’ll try to use sprite image texts instead. [import]uid: 98774 topic_id: 18968 reply_id: 73240[/import]

This will be fixed in the next daily build (715 or after).

The reason it suddenly works in iOS5 was b/c this was actually an Apple bug that they fixed in iOS5. We found a workaround that works across iOS4 and iOS5 [import]uid: 26 topic_id: 18968 reply_id: 75591[/import]

Great!
That means I’ll be able to use any font size in the future. I’ve been getting around this issue by only using font sizes known to work with CJK text.

EDIT:
I’ve tested with build 715 and can confirm that the issue has been fixed. All font sizes for CJK text are now shown properly.

Tested on iOS 4.3.5, 5.0.1 and 5.1 beta2 (iOS 3.1.3 is not supported as of Corona build 707 so it has been skipped).

Thanks for the quick fix! [import]uid: 70847 topic_id: 18968 reply_id: 75604[/import]

How to Display Chinese Text?
I am a new developer. Why I use the code in the above, but only output something I can’t read. Is that anything I don’t know? I try it in the simular. [import]uid: 30189 topic_id: 18968 reply_id: 78489[/import]

Do you save your lua files as UTF-8? [import]uid: 70847 topic_id: 18968 reply_id: 78494[/import]

Oh, thank you.
I find the way to fix it. Yes, save it as UTF-8 without BOM.
http://developer.anscamobile.com/content/corona-fails-compile-when-mainlua-saved-utf-8-bom [import]uid: 30189 topic_id: 18968 reply_id: 78504[/import]

Thanks to all of you.

Here is the daily build link…and I tried latest build (1/28 2012 version)
https://developer.anscamobile.com/downloads/daily-builds/

It works perfectly on my iPod touch with the iOS 4.35 version!
Great job Ansca team!! And thanks ingemar!
God bless you! [import]uid: 98774 topic_id: 18968 reply_id: 83437[/import]