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$
0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.