UTF8 iPhone can't read amharic letters - iphone

It has suddenly happened that I need to output a couple of strings in amharic (ethiopian) and some quite exotic (I think tamil if in Cambodia they use it). I store these strings in DB and they look fine -> (ሳንቲም).
After retrieving them from db with:
currObj.originalUnitName=(originalUnitName)?[NSString stringWithUTF8String:originalUnitName]:#"";
I am getting in device nice squares only which imho means iPhone has no proper decoder. Is there any solution for this case?
P.S I am using iOS 5.1
Thank you in advance.

You have to use special font that provides these characters. "Abyssinica SIL" (http://software.sil.org/abyssinica/download/) worked in my case.

What font are you using to output the NSString?
There's number of fonts in iOS without a proper UTF8 support. (e.g. Helvetica Neue)
I suggest you to perform further tests with standard Helvetica, which is (almost) fine.

Related

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.

How to display emoji char in HTML

I saved the face "savouring delicious food emoji" to database, and read it in php json_encode which show "uD83D\uDE0B"。 but usually we use one <img /> label to replace it .
however,usually I just find this format '\uE056' not "uD83D\uDE0B",to replace with pic E056.png .
I don't know how to get the pic accroding to 'uD83D\uDE0B'.someone know ?
What the relation between 'uD83D\uDE0B' and '\uE056', they both represent emoji "savouring delicious food"?
The Unicode character U+1F60B FACE SAVOURING DELICIOUS FOOD is a so-called Plane 1 character, which means that its UTF-16 encoded form consists of two 16-bit code units, namely 0xD83D 0xDE0B. Generally, Plane 1 characters cause considerable problems because many programs are not prepared to deal with them, and few fonts contain them.
According to http://www.fileformat.info/info/unicode/char/1f60b/fontsupport.htm this particular character only exists in DejaVu fonts and in Symbola, but the versions of DejaVu I’m using don’t contain it.
Instead of dealing with the problems of encodings (which are not that difficult, but require extra information), you can use the character reference 😈 in HTML. But this does not solve the font problem. I don’t know about iPhone fonts, but in general in web browsing, the odds of a computer having any font capable of rendering the character are probably less than 1%. So you may need to use downloadable fonts. Using an image is obviously much simpler and mostly more reliable.
U+E056 is a Private Use codepoint, which means that anybody can make an agreement about its meaning with his brother or with himself, without asking anyone else’s mind. A font designer may assign any glyph to it.
IMPORTANT: As of this posting, the only browser that doesn't automatically support emojis is chrome.
FOR CHROME:
Depending on what server side language you are using, you should be able to find a library that converts emojis for you. I recently needed to solve this issue with php and used this library:
https://github.com/iamcal/php-emoji
The creator essentially created a sprite and adjusts the css according to the unicode of the emoji. It isnt pretty, but luckily he/she did all the grunt work for you. If you're using a different language you should be able to find something similar.
how do I put those little boxes into a php file?
Same way as any other Unicode character. Just paste them and make sure you're saving the PHP file and serving the PHP page as UTF-8.
When I put it into a php file, it turns into question marks and what not
Then you have an encoding problem. Work it out with Unicode characters you can actually see properly first, for example ąαд™日本, before worrying about the emoji.
Your PHP file should be saved as UTF-8; the page it produces should be served as Content-Type: text/html;charset:UTF-8 (or with similar meta tag); the MySQL database should be using a UTF-8 collation to store data and PHP should be talking to MySQL using UTF-8.
However. Even handling everything correctly like this, PCs will still not show the emoji. That's because:
they don't have fonts that include shapes for those characters, and
emoji are still completely unstandardised. Those characters you posted are in the Unicode Private Use Area, which means they don't have any official meaning at all.
Each network in Japan uses different character codes for their emoji, mapped to different areas in the PUA. So even on another mobile phone, it probably won't display the correct character, unless you spend ages manually converting emoji codes for different networks. I'm guessing the ones you posted above are from SoftBank (iPhone?).
There is an ongoing proposal led by Google and Apple to collate the different networks' emoji and give them a proper standardised place in Unicode. Until then, getting emoji to display consistently across networks is an exercise in unhappiness. See the character overview from the standardisation work to see how much converting you would have to do.
God, I hate emoji. All that pain for such a load of useless twee rubbish.

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.

iPhone - How to load Chinese text

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.

Converting hebrew text to an image using imagemagick

I need to convert text to an image. Using imagemagick I can get this done.
However, part or all of the text could be in Hebrew (an RTL language).
This means the words in Hebrew are rendered backwards.
If I was assured that the text was only Hebrew, I would have just reversed the text before sending it to ImageMagick. However, this solution won't work if part of the text is in English.
Does anyone have any idea how this can be done?
P.S. I'm not committed to using ImageMagick, if a better way comes up.
However, the solution should work for both Linux and Windows (I might be able to live with a non-windows solution, but a multi OS solution is preferable).
Thanks,
Niv
i see this link
http://www.experts-exchange.com/Software/Photos_Graphics/Web_Graphics/Q_21766928.html
they suggest
Maybe Unifier (http://www.melody-soft.com/html/unifier.html) or Encoding Master (http://www.elfdata.com/encodingmaster/index.html)
Sounds like your real issue is to re-order the bidirectional text for imagemagick. A job for the Unicode bidirectional algorithm. See http://unicode.org/reports/tr9/ That report lists two reference implementations. Or see this one: http://fribidi.org/