lua 5.1 translate utf8 russian characters to unicode? - unicode

Hello I am wondering if it is possible to translate Привет into \u041f\u0440\u0438\u0432\u0435\u0442 in lua 5.1. There is no utf8 library, nor no unicode library inside this game. I've looked for a library on github that does this for me, but I can't find one that is suited for this

https://github.com/perfgao/lua-resty-unicode/blob/master/lib/resty/unicode.lua
utf8_to_unicode("Привет")
>"\u041f\u0440\u0438\u0432\u0435\u0442"

Related

How can i create iTextSharp pdf in Hindi font?

I am trying to build desktop application for Hindi PDFs in c#. But the Unicode encoding is not well supported.Any idea to fix this.
string ARIALUNI_TTF = path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts), "ARIALUNI.TTF");
bf = iTextSharp.text.pdf.BaseFont.CreateFont(ARIALUNI_TTF, BaseFont.IDENTITY_H,BaseFont.EMBEDDED);
iTextSharp.text.Font font = new iTextSharp.text.Font(bf, 8, iTextSharp.text.Font.NORMAL);
Can Identity_H will give support for Hindi Encoding?
Hindi is not supported yet. A font like mangal.ttf, that supports the Devanagari script, will show you in iTextSharp the glyphs but not the ligatures. Work is being done on the Indic front not only for Hindi support but also for Telegu, Gujarati and others.
You basically require support for Asian Characters. A similar thread can be found here(stackoverflow). The implementation revolve around usage of BaseFont (use createFont method), which indicates using font and appropriate encoding. You can find the example on the official site of iText here. Note that the example is in Java, but the same implementation is available in .Net as well.

PDFTable Unicode support

I'm using PDFTable from http://www.vanxuan.net/tool/pdftable/ which is based on FPDF class. I managed to export HTML table to pdf using PDFTable. However, I'm facing one issue. The non-English characters are all displayed in gibberish. It doesn't seem that it supports unicode. The language I'm trying to display is Arabic and Russian.
I could, theoretically, create a similar class to PDFTable, which is inherited from FPDF, and develop it from scratch to add unicode support. But it's a lot of work. Has anyone done something like that and perhaps could share? Thank you!
For unicode support, the best way is to use tFPDF from http://www.fpdf.org/en/script/script92.php. It's a fork of FPDF with specifically to support unicode. The class is based on the latest FPDF version 1.7.

UTF8 iPhone can't read amharic letters

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.

i18n / Markdown - Does Markdown support internationalization?

I'm building a CMS which needs to manage content in english, chinese, and spanish at a minimum. Do most markdown implementations handle UTF-8 encoded text? Is the Markdown language designed to be used with non-english languages? I'm currently using Markdown Extra by Michel Fortin.
Markdown is languages neutral so you can use it easily as it does not care about encoding
as long as ASCII is a subset of it.
However I would not recommend you using smarty-pants as they designed for English so you may get incorrect quotes in your language.
As Michel Fortin (a french speaking guy), I use his library (the extra one) with special characters like éà without any problem

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.