file encoding

Post Reply
aitchon
Posts: 118
Joined: Mon Jan 22, 2007 10:30 am

file encoding

Post by aitchon »

When writing out a file using <write>, what is the default encoding of the file? Is there anyway to save the file in a different encoding?
User avatar
Kai
Site Admin
Posts: 1271
Joined: Tue Apr 25, 2000 1:27 pm

file encoding

Post by Kai »

No encoding is used; whatever is printed is copied verbatim to the file. There are various <fmt> codes to encode output, e.g. to print ISO-8859-1 data in $string as UTF-8 to the file:

<write $theFile>
<fmt "%V" $string>
</write>

Note that if htmlmode is on (the default for .html function extensions), HTML-escapement of literal-printed variables (`$var' instead of e.g. `<fmt "%s" $var>') will occur in the file, just as it would if the variables were printed to stdout.
Post Reply