iPhone - How to load Chinese text - iphone

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.

Related

How to put utf-8 text to input field Unity

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.

For eBook Kannada font (Nudi 01 e b.ttf) is converting to gibberish English font in iPad, iPhone

I've created a Kannada eBook using Sigil, Kannada fonts are working properly in Samsung, HTC, Sony (tested in some models). But not working in iPad, and iPhone.
Can anybody please suggest me some solutions for this?
I believe the font you mention is a so-called "ASCII" font, rather than a Unicode-encoded font. In that case, correct display is a matter of luck and is not guaranteed. Even if it works on today's Sony devices, it might stop working tomorrow. According to the spec, EPUBs must be Unicode.
Yes, I am well aware of the issues involved in re-coding legacy content in ASCII encodings for Kannada and other Indic languages into Unicode. However, from the standpoint of future-proofing your content and guaranteeing operability across platforms, it is an investment that will prove worthwhile.
It would also be helpful if you could create a one-page, one-line book with this problem and post the XHTML and the content.opf file.
UPDATE
It appears that version 5.0 of Nudi includes Unicode-conformant fonts, see this article, and also includes a converter.
This mainly happens because of the missing font. Try to download Sigil font onto your device which cannot read kannada fonts.
Alternatively, if you have typed in MS Word using the Sigil Font then While saving select save options and tick the box "Embed Fonts". By doing this your document can be read in any device without the reader having that particular font.

Solr.NET and Chinese characters

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.

Character convert ion for Spanish characters in iPhone

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!

how do I specify a system font that handles wide characters on the iphone?

This is sort of a generic question due to my lack of experience with fonts, so a little patience and/or pointing in the right direction to get more info would be appreciated. I have an iphone app and am noticing that when I print some text on my labels, I end up with garbage when the string contains non-ascii, like Korean for example.
My guess is that since my UILabels, for instance, are using the system font, perhaps the system font does not support displaying wide characters. However, I'm left with a few beginner questions:
1) How do I set the system font so my iphone sdk objects that use the system font use it?
2) Does this sound correct that the system font probably doesn't support wide characters and is the reason I see garbage when I have characters out of the normal ascii range?
Thanks. Let me know if I need to clarify the problem please.
Update:
I later suspected maybe it was a problem on my server end so posted this related but not identical post here: does google app engine display unicode differently in StringProperty v StringListProperty objs?
It turns out the problem was not with the font, but with improperly encoding the data response from the server into Ascii when I should have used UTF8. It appears the font supported unicode to begin with.