What is the problem with RTL languages in WP8

I tried to use Corona Card for WP8, and it was working very well.
but when I added the  Arabic code I only see question marks.
What is the problem, the code on android and IOS are working without any error.


English

Code

-- -- Abstract: Hello World sample app. -- -- Version: 1.2 -- -- Sample code is MIT licensed -- Copyright (C) 2014 Corona Labs Inc. All Rights Reserved. -- -- Supports Graphics 2.0 ------------------------------------------------------------ local background = display.newImage( "world.jpg", display.contentCenterX , display.contentCenterY) local myText = display.newText( "New App", display.contentCenterX, display.contentWidth / 4, native.systemFont, 50 ) myText:setFillColor( 1.0, 0.4, 0.4 )

Arabic

-- -- Abstract: Hello World sample app. -- -- Version: 1.2 -- -- Sample code is MIT licensed -- Copyright (C) 2014 Corona Labs Inc. All Rights Reserved. -- -- Supports Graphics 2.0 ------------------------------------------------------------ local background = display.newImage( "world.jpg", display.contentCenterX , display.contentCenterY) local myText = display.newText( "برنامج جديد", display.contentCenterX, display.contentWidth / 4, native.systemFont, 50 ) myText:setFillColor( 1.0, 0.4, 0.4 )

Thanks And Regards,

Your Lua file is probably not using a UTF-8 encoding.  Windows’s text editor typically do not set the text encoding of a file to UTF-8 by default.  Visual Studio usually sets it to a “codepage” of the language you’re typing in, which definitely won’t work.  And Notepad is worse and will set it to a non-compliant UTF-8 format with a signature byte at the beginning of the file which will cause a Lua runtime error.  So, you have to be careful when entering unicode text on Windows and make sure to set the encoding yourself.  It’s not as easy as Mac where it always defaults to UTF-8.

To change the encoding of your Lua file, you’ll need to do the following:

  1. Open your project in Visual Studio.
  2. Go to the “Solution Explorer” panel and double click on the Lua file that contains Arabic text.
  3. Click on the “File\Advanced Save Options” menu item.
  4. Select “Unicode (UTF-8 without signature)” from the drop-down box.  (NOTE: It must be *without* a signature!)
  5. Click the OK button.
  6. Click the Save button to save your Lua file’s encoding changes.
  7. Rebuild/rerun your project.

You’ll need to repeat the above steps for every Lua file that you have which contains your Arabic text.

I’ve tested this on my end and Arabic text definitely shows up on my WP8 device.

I hope this helps!

Thank you so much my dear friend Joshua Quick,

your instructions helped me a lot

Your Lua file is probably not using a UTF-8 encoding.  Windows’s text editor typically do not set the text encoding of a file to UTF-8 by default.  Visual Studio usually sets it to a “codepage” of the language you’re typing in, which definitely won’t work.  And Notepad is worse and will set it to a non-compliant UTF-8 format with a signature byte at the beginning of the file which will cause a Lua runtime error.  So, you have to be careful when entering unicode text on Windows and make sure to set the encoding yourself.  It’s not as easy as Mac where it always defaults to UTF-8.

To change the encoding of your Lua file, you’ll need to do the following:

  1. Open your project in Visual Studio.
  2. Go to the “Solution Explorer” panel and double click on the Lua file that contains Arabic text.
  3. Click on the “File\Advanced Save Options” menu item.
  4. Select “Unicode (UTF-8 without signature)” from the drop-down box.  (NOTE: It must be *without* a signature!)
  5. Click the OK button.
  6. Click the Save button to save your Lua file’s encoding changes.
  7. Rebuild/rerun your project.

You’ll need to repeat the above steps for every Lua file that you have which contains your Arabic text.

I’ve tested this on my end and Arabic text definitely shows up on my WP8 device.

I hope this helps!

Thank you so much my dear friend Joshua Quick,

your instructions helped me a lot