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$

1 Answer 1

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$
1
  • $\begingroup$ oh perfect it worked!, many thankx! $\endgroup$
    – Gluoncito
    Jul 28, 2013 at 2:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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