RazorPDF and Chinese character - character-encoding

I use Razor-PDF to create PDF.
like the following article:
http://www.dotnetjalps.com/2013/06/Creating-PDF-with-ASP-Net-MVC-and-RazorPDF.html
But I have a problem. the data consists of Chinese characters,but Chinese characters don't appear in PDF file I created. can anyone help me how to do this? thanks

Related

objective-c, PDF, How to solve "failed to parse embedded CMap." issue in PDF Seaching?

I am trying perform searching text in PDF, My project works fine on mostly PDF, but it fails to search text on some PDF, and xcode shows this message on console :
"failed to parse embedded CMap." How to solve this issue, So that I can search text on all PDF. Any suggestion will be great. Thanks in advance .
In general, it is impossible to search for text in all PDFs. This is for two main reasons:
PDFs use character codes that do not correspond to Unicode. A Cmap is used in this case to associate PDF character codes with a Unicode, but is not required to be present in the PDF document.
Even if a Cmap is included, the characters of text are not guaranteed to appear in order in the PDF document. PDF displays the glyphs corresponding to a character code based on geometry not on text.

How to convert Casa_Batll%C3%B3 to Casa_Batllȯ(Latin letters)in ios

I would like to convert convert Casa_Batll%C3%B3 to Casa_Batllȯ.
NSLog(#"Converting String:%#",[#"Casa_Batll%C3%B3" stringByReplacingOccurrencesOfString:#"%c3%b3" withString:#"ȯ"]);
Using this code, i get only known latin characters or some special characters but not unknown latin characters or special characters. Actually i am getting the string from database which is already created so i don't know about those strings in this database. I have also tried using NSString+HTML.m in this MWFeedParser. But i didn't get anything. I have also seen these link1 and link2. Please help anyone to me.
Use stringByReplacingPercentEscapesUsingEncoding:.
NSLog(#"Converting String:%#",[#"Casa_Batll%C3%B3" stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]);
Adjust the encoding as appropriate.

ios: reading Chinese characters of a html source code

I'm trying to read and save Chinese characters written in websites !
For example:
html source code has this line:
title="网络歌手"
when I read this as NSString, the value returned is in the format like:
\UT0212\UT0999
something like that.
I have tried converting using gb2312 and utf-8, etc. encoders, but I don't quite get the exact Chinese. Sometimes I get close to Chinese, but not the exact words.
Any help is appreciated !
Regards,
Suraj
http://www.pinyin.info/tools/converter/chars2uninumbers.html
I believe you would have to convert the characters to unicode...similar to what they did in the above article

Problem with cyrillic characters in Ruby on Rails

In my rails app I work a lot with cyrillic characters. Thats no problem, I store them in the db, I can display it in html.
But I have a problem exporting them in a plain txt file. A string like "элиас" gets "—ç–ª–∏–∞—Å" if I let rails put in in a txt file and download it. Whats wrong here? What has to be done?
Regards,
Elias
Obviously, there's a problem with your encoding. Make sure you text is in Unicode before writing it to the text file. You may use something like this:
ic = Iconv.new('UTF-8//IGNORE', 'UTF-8')
your_unicode_text = ic.iconv(your_text + ' ')[0..-2]
Also, double check that your database encoding is UTF-8. Cyrillic characters can display fine in DB and in html with non-unicode encoding, e.g. KOI8-RU, but you're guaranteed to have problems with them elsewhere.

Rails charachter encoding problem view to controller

The character encoding starts to irritate me.
It took me a while to get everything from the DB in the right encoding on the screen, but with help from the i18n helper, this worked out.
Now I only have one more problem: saving text...
If i add some letters with accents (eg é ç ...) in a text field and want to save it, already in my controller it show as some exotic combination of characters.
Could someone tell me why this is and how I can fix this.
Everything is in UTF-8 btw
Thanks!
//Edit:
When I save the form, this is my log output
Parameters: {"free_text"=>"test 1 2 é",
And everything is capable of UTF-8...
Can you illustrate your output?
Let me guess your situation.
Supposed that you log those characters in controller in log/development.log or production.log.
If you view that log in terminal, you should ensure your terminal is capable to show UTF-8, with appropriate font. Also, your shell is capable to show UTF-8 and so do your the text viewer.

Resources