7
$\begingroup$

I exported a list of characters say:

ClearAll[t, r, \[Theta], \[Phi]];
Export["hello.txt", {t, r, \[Theta], \[Phi]}, "List"];

the file has the correct symbols when opened with a text editor, however, when I imported it with Mathematica:

old = Import["hello.txt", "List"]

I get:

{t, r, θ, Ï}

Any idea of how can I recover the original symbols?

$\endgroup$
9
$\begingroup$

You have to specify the correct character encoding:

Export["hello.txt", {t, r, θ, ϕ}, "List"];

old = Import["hello.txt", "List", CharacterEncoding -> "UTF8"]

(* ==> {"t", "r", "θ", "ϕ"} *)
$\endgroup$
  • $\begingroup$ oh perfect it worked!, many thankx! $\endgroup$ – Gluoncito Jul 28 '13 at 2:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.