SQLite database utf-8 characters

Hi,

After spending the last two months working on a completely different project I am now making a business app using G2.

In this project I need to read/write from/to databases using SQL.

I have never worked with databases before so please forgive me if the error is very obvious to you :wink:

My first attempt has been successful - I created a database in SQLite Manager and made sure that UTF-8 encoding is selected.

Then I was able to access this database in Corona and print the table(s) in the command prompt.

But - whenever I try to print a line with a German Umlaut like “Ä, Ö, Ü, etc…” then the print statement shows me a really weird character. It seems like Corona does not recognize the Umlaut and inserts a placeholder.

So my question is - Do I have to add anything to config.lua or do I have to add something else in order to get Corona to “understand” these UTF-8 characters?

Daily Build 2146,

Windows 8.1 64 Bit

Edit: I just tried to use a single print statement only and it gives me the same results:

print("Umlaut: "… “Ä”)

I did not use German Umlaute in the past so I don´t know if this is a new problem related to this particular daily build.

Thanks,

Max

This problem does not occur with my Macbook Air mid-2012 and daily build 2148. So it might be a windows issue?

The default font used by the Windows’ command prompt (aka: DOS box) does not support Unicode characters.  You’ll need to change it to a font to that does support Unicode by doing the following:

  1. Left click the “C:” icon in the command prompt window’s top left corner.

  2. Click on “Properties” from the menu.

  3. Select the “Font” tab in the Properties window.

  4. Select a font that support unicode from the list such as “Consolas” or “Lucida Console”.

  5. Click the OK button.

After doing the above, the command prompt will now correctly display Unicode characters.  Note that this is a legacy thing on Microsoft’s part.  So, the above applies when using a separate Command Prompt window outside of Corona too.

Oh wow, thank you very much Joshua! :smiley:

Live and learn :wink:

Best,

Max

This problem does not occur with my Macbook Air mid-2012 and daily build 2148. So it might be a windows issue?

The default font used by the Windows’ command prompt (aka: DOS box) does not support Unicode characters.  You’ll need to change it to a font to that does support Unicode by doing the following:

  1. Left click the “C:” icon in the command prompt window’s top left corner.

  2. Click on “Properties” from the menu.

  3. Select the “Font” tab in the Properties window.

  4. Select a font that support unicode from the list such as “Consolas” or “Lucida Console”.

  5. Click the OK button.

After doing the above, the command prompt will now correctly display Unicode characters.  Note that this is a legacy thing on Microsoft’s part.  So, the above applies when using a separate Command Prompt window outside of Corona too.

Oh wow, thank you very much Joshua! :smiley:

Live and learn :wink:

Best,

Max