Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

folowing is the content my test nb File: pdfTest.nb, contain some chinese characters:

SampleCode1:pdf输入不正常。

After Save as or Export, pdf file looks well for the Chinese content.

But when Import, it seems become WindowsANSI Encoding.

When I Import the pdf file

Import["E:\\Users\\Quaternions\\Desktop\\pdfTest.pdf","Plaintext",CharacterEncoding->"CP936"]

Show this

SampleCode2:pdfÊäÈë\.b2»Õý\.b3£¡£

When I Export and Re-Import the .txt file, it works fine.

Import[Export["temp1.txt",%,CharacterEncoding->"WindowsANSI"],CharacterEncoding->"CP936"]

good result:

pdf输入不正常。

my-enviroment is windows 8 mathematica 9.0 chinese version.

$CharacterEncoding
CP936

Maybe someone is hard to test.

My question is:

1: How to directly import the pdf file contain chinese characters and show well.

2: if the solution for question 1 is not possible, is it necessary to Export using CharacterEncoding->"WindowsANSI" and re-Import? ,

ie. How to convert the characterEncoding in notebook without the export manipulation? Convert SampleCode2 to SampleCode1

Futhermore, When I import some pdf generated by Tex or obtain other where, also will encouter with CharacterEncoding Problem. I think Import Pdf File should better add an Elements that Import pdf pages as Rasterized image list.

share|improve this question
    
@ruebenko sorry for that, Let me edit , I think I mis-edit them by myself. I just wanna make them a littel different in appearance –  HyperGroups May 8 '13 at 13:02
1  
Hi HyperGroups, I think the chinese version Mathematica might use different UnicodeLanguageFontMapping.tr file than english/japanese version. And there might be some other differences as well. But unfortunately, most people (including me) on this site don't have any access to chinese versions to test your problem, so it could be hard here to get a complete answer for your question. Nevertheless, I would suggest you investigating the problem with help of some HEX/Binary file viewer, and with a deeper understanding about character encoding, GBK, UTF-8, Unicode, etc. –  Silvia May 8 '13 at 17:23
    
@Silvia, thanks for tips about encoding, I remember that Export pdf cause some encoding problem with characters in Chinese before the Chinese version was released. And this(export) was solved after the Chinese version released. –  HyperGroups May 9 '13 at 2:30
    
I remember some problem with GBK characters, but not sure whether they are solved or not. About the encoding, You may want to check out this: Quiet[Outer[Check[FromCharacterCode[ToCharacterCode["en汉字",#1],#2],$Failed]&,#,‌​#]&@$CharacterEncodings]. –  Silvia May 9 '13 at 7:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.