MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

writing greek characters to files

  • To: mathgroup at
  • Subject: [mg46846] writing greek characters to files
  • From: semorrison_ at (Scott Morrison)
  • Date: Wed, 10 Mar 2004 04:57:43 -0500 (EST)
  • Sender: owner-wri-mathgroup at

I'm writing a package in which I need to save the results of various
long calculations.

I wrote two simple functions;



DefinitionString[expr_]:=ToStringHeld[expr] <> " = " <>
   ToString[expr,InputForm] <> ";\n"

Now, for example, with


DefinitionString[b] produces the string "b = 6;\n". Great. I then
write it to a file with, for example

WriteString[stream, DefinitionString[b]];

I run into problems if in the example above I replace b everywhere
with beta (entered as <esc>b<esc> in the front-end). In this case the
file "tmp" contains an unprintable character (pair of characters, in
fact), whereas I'd like it to contain \[Beta] = 6;.

If I use instead DefinitionString[\[Beta]]>>"tmp", it correctly prints
the string, but with quotation marks, making it useless for input...

Any suggestions?

Thanks, Scott Morrison

  • Prev by Date: Found my While problem
  • Next by Date: Re: append to a file
  • Previous by thread: Found my While problem
  • Next by thread: Re: writing greek characters to files