Charset problems with .lc web page

Tim Selander selander at
Tue Jan 5 18:58:58 EST 2016

Hi Lyn,

When I first tried your tip, it didn't work for me. But when I looked at 
the tutorial you linked to, I saw that the
<?lc put header "Content-Type: text/html; charset=UTF-8" ?>
was the very first line of the .lc file, before <html> or anything else.

When I tried that, it worked great! I had been inserting the command:
put header "Content-Type: text/html; charset=UTF-8"
into the first line of my <?lc script on the page.... and that didn't work.

So now I have two solutions, and, yes, yours is quite simple!

Thanks so much for persisting on this with me!

Tim Selander
Tokyo, Japan

On 16/01/06 8:41, Lyn Teyla wrote:
> Tim Selander wrote:
>> 1) <?lc set the outputTextEncoding to "utf-8" ?>  --> must be the first line of the .lc
>> 2) set the outputTextEncoding to native   -->  must be the first line of the first <?lc  ?> script in the file
>> If you put "set the outputTextEncoding to native" later in the script, UTF-8 above that line will be garbled; after that line it will show properly.
> This can get unnecessarily convoluted if you have to keep alternating between "native" and "utf-8" outputTextEncodings between different blocks of LiveCode script and HTML.
> I can imagine that one would tend to forget to change the outputTextEncoding somewhere along the way.
> Did you run into any problems with the "put header" method that I had suggested, where you only need to insert a single line at the top of the file?
> I use the single-line solution and it works perfectly fine on many versions of revServer and LiveCode Server, including 3.5, 6.6.2 (the one you’re using), 6.7.8, 7.1.1, and 8.0.0 DP 12.
> This article on also mentions the same solution. Perhaps it explains it better than I did:
> Lyn
> _______________________________________________
> use-livecode mailing list
> use-livecode at
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:

More information about the Use-livecode mailing list