UTF-8 encoding woes...

I have a Chinese text which I want to dynamically load into my app, so I'm connecting to my server using network.request. However, the Chinese UTF-8 now arrives as garbage text when I print it on the console or display it in a text on screen. The same text as returned from my server shows fine in, say, Google Chrome. I'm declaring a http header ('Content-Type: text/plain; charset=utf-8'), I'm *not* using a BOM Byte-Order Mark at the beginning of my file, and I've tried saving using different editors, to no avail so far. Can anyone please help? Thanks!!

PS: If I'm not entirely mistaken then I *did* get to this to work in an older version of Corona (but I might be mistaken). I'm using basically the same code now but maybe I do something else differently or the Corona build number changed...

I'm experiencing something similar. text such as "Seriøusly" when read from a webpage is coming back as "Seriøusly" I can't figure out a way around this.

also I saw your post on stackoverflow, did you submit this as a bug already?

Has anyone solved this?

I reported it as a bug, it was fixed in one of the daily builds

Yes, it's solved in the newer builds. Chinese text now comes through fine. (Now I included a little ?supportsUnicode=true parameter for the URL I'm fetching so that my app can differentiate between old and new installs, and send text appropriately.)

What version of the daily builds make this work? I am sending Swedish åäö characters from my app to my server and they are still stored as crappy text.

It worked for a while already, and most definitely in the latest builds (on iOS anyway, don't know about Android). Are you sure your server is sending the right character encoding header, e.g. 'Content-Type: text/plain; charset=utf-8'? You can check the URL with http://www.webconfs.com/http-header-check.php

Hey
My problem is that its when I user the Facebook Connect API and then the names which contains Swedish characters ÅÄÖ it will not send it from the app to the server correct. Or do you mean that the receiving server has to be configured to receive UTF-8 encoded data?

To clarify, the issue I had which is solved now was to receive Unicode data. Your issue seems to be to send Unicode data, so it's the reverse. Perhaps in your case the receiving server doesn't understand you're sending UTF-8? Just a guess...

views:1651 update:2011/9/29 9:22:17
corona forums © 2003-2011