I building a app chat, and I come from Vietnam. But Input field in Unity dont show Vietnamese text. How I can get text from Input field is utf-8 text.
I'm not a native English speaker, so I'm sorry for every mistake.
I believe GUI in Unity uses UTF-16 and not UTF-8. You should be able to encode your file with UTF-16 in Monodevelop.
Related
I have an iPhone application in which I am sending text in an UITextview to a server through a web service. and in the next page I am displaying the list of comments from the server through the web service. Everything is working fine except when I insert emoji/emoticons in the UITextview.
The next page displays square boxes instead of some emoji character (not all).
I have noticed that:
Working: I have inserted one emoji character in UITextview from an emoji keyboard and printed its code in log, \u2601, and submitted this text to the server. In the next page I got the same unicode \u2601 and it's working fine. It shows me the emoji icon.
Not Working: Now I have inserted another emoji character in the UITextview from the emoji keyboard and printed its code in log, \ud83d\udc16, and submitted this text to the server. In the next page I got a unicode codepoint which is different from what I sent: \uf416. iPhone doesn't recognize this unicode so it gives me a square box.
So what is the problem here? It's not working only when the emoji character has a pair of unicode codepoints.
The database in which the comment is stored is MySQL version 5.5.
Why does the emoji character code pair change when retrieved from the server? How to decode the retrieved Unicode into its original form so iPhone can recognize it?
The character U+F416 is in one of the Private Use Areas (PUA).
Likely, some code on the way from the app to the database and back replaced the emoji with this character. This could be any of the components on this way, e.g. the client library tha you use to communicate with the service, the web service, the database interface, or the database itself. Try to tackle each of this layers individually, or follow the character through the layers to check whether it is still correct.
Thanx Mar Byers, You gave me hint. I have read what is Unicode planes and what is surrogates and how it works. I have found that that is no server problem actually, because my SQL server version is 5.5 that has character set uyf8mb4, i have used that set in Comments column.
Now the problem with SBJSON that i used in my app to decode json response geting from server.SBJSON decode that surrogate pair(UTF16 UTF16) in one unicode UTF16, and thats why the emoji with surrogate pair is not displayed. Apple introduce json library NSJSONSerialization for ios5 and later os. I used that library to decode json response and my code work like charm..:)
I have got solution from here
http://blog.manbolo.com/2011/12/12/supporting-ios-5-new-emoji-encoding
and here
http://blog.manbolo.com/2012/10/29/supporting-new-emojis-on-ios-6
thanx to #Manbolo Blog.
I have a search index that handles both English and Chinese content. All documents are imported to SOLR by Solr.NET
When I search the Chinese content from the browser (localhost:8389/solr/...) everything works fine, but when I execute the search using Solr.NET then I get 0 hit :(
I tried to set up a logger to see what's the difference between browser search and Solr.NET search but I get question marks (??????) instead of Chinese characters.
Any help would be greatly appreciated!
Open solr0.log with your browser instead of Notepad++ in order to make sure that this is a real problem and to find out which encoding the file was saved as - if it's not Unicode, chances are that Solr.NET can't search it.
Notepad++ has been known to have trouble with Chinese, either because of the encoding (Notepad++ doesn't support typical Chinese encodings like gb or big5) or because of the default font, which may or may not support Chinese characters. Browsers are more forgiving and will do anything in order to display the file correctly. In fact, to convert non-unicode Asian encodings to unicode, I often open a file in my browser, which will detect the correct encoding and display the raw contents, and then CTRL+A CTRL+C CTRL+V everything into Editor, save as UTF-8, done.
I am writing an iPhone app, and I am consuming web services to get some info. This info is UTF-8 encoded, but some Spanish special characters are shown in a strange way (for instance, Ó is shown as Ó).
How could I convert them?
Thanks.
Check this solution ,it may help:
Spanish character encoding - iphone
Greetings from another spaniard!
I am using text to speech conversion API for iphone app.
When I pass on a text it responds with the audio data which plays the same text.
This works fine for english language.
But when I try and send a french word in request. It responds with an audio which repeats the same word 3 to 4 times.
What could be wrong?
It was an issue with the encoding of the data that I sent to the server.
Actually french language had some characters which needed to be encoded. So encoding those strings with UTF8Encoding did the trick.
Hope this helps someone. :)
I have a file with Chinese text that I want to use in my XCode project (I'm planning to load it through a database as it is lot of text), the problem is I don't know how to add the font to my project so that it's viewable when used on an iPhone?
Thanks :)
I currently live in China and deal with this all of the time. Usually the problem is not the font, it's the way the characters are represented. All unix variants use UTF-8 (most OSes) Windows uses UTF-16/32 (I forget). The cool thing about UTF-8 is that it is backward-compatible with ASCII. Open your text in the TextEdit or Firefox. In Firefox you can tell the browser to try different encodings, then save it to a file. If it is the wrong encoding, Mac TextEdit can convert between UTF-8 and UTF-16. Once you have the string in UTF-8 encoding, you can display it in your text field.
When displaying text to a textfeild make sure to display a UTF-8 string, not an ASCII string.
If you are interested in the details of UTF-8, just say so and I will expand on the UTF-8 design.
rw
The iPhone already has chinese fonts installed by default.
I've had some success using the FontLabel library. It allows you to use arbitrary .ttf fonts in your app and it's Apache-licensed:
http://github.com/zynga/FontLabel
For the majority of cases this has worked perfectly for me.