I'm using Mathematica10.0.2 on Win7
suppose I have a txt file named test_Import_characters.txt(http://pan.baidu.com/s/1hsvy6xQ) which contains two lines of string example(copied from http://broadskyblog.blogspot.com/):
in the meantime
in the next few…+NOUN
If I copied string into Mathematica directly and FullForm
it, it reads:
"in the meantime
in the next few\[Ellipsis]+NOUN"
It's fine. However, if I Import
it and then FullForm
it, strange thing happened:
However, If evaluate
FullForm@Import@
Export["D:\\English\\fixed_expression\\test_Import_characters_2.
txt", "in the meantime
in the next few\[Ellipsis]+NOUN", "Text"]
then all thing is fine, no Dis-cre-tion-ary-Hyp-hen appeared.
the test_Import_characters.txt could be download from http://pan.baidu.com/s/1hsvy6xQ or you can copy it from http://broadskyblog.blogspot.com/ and paste it into a txt file.
Problem remains even Import the file with explicit options CharacterEncoding -> "UTF-8":
FullForm[Import[
"D:\\English\\fixed_expression\\test_Import_characters.txt", "Text",
CharacterEncoding -> "UTF-8"]]
Dis-cre-tion-ary-Hyp-hen still appeared
Import
does import your text file as it is. It is probably an encoding issue. I cannot tell what encoding your file has as none that I tried gave the original from the website. Try creating a UTF-8 encoded file and import usingImport["file.txt", "Text"]
. $\endgroup$