Charset problems with .lc web page

Lyn Teyla lyn.teyla at gmail.com
Tue Jan 5 18:41:50 EST 2016


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 HostM.com also mentions the same solution. Perhaps it explains it better than I did:

https://www.hostm.com/tutorials/livecode/utf-8-output

Lyn






More information about the Use-livecode mailing list