Encoding in LC server - the final piece of the puzzle

Ralf Bitter rabit at revigniter.com
Sun Sep 17 06:31:12 EDT 2023


Neville, you need to send the header
before outputting anything else.
So, this means your LC server script
should send the header and then the HTML data.


Ralf



On 17.09.2023 01:56, Neville Smythe via use-livecode wrote:
> 
> Ralf wrote
>> did you try:
>>
>> put header "Content-Type: text/html; charset=" & quote & "UTF-8" & quote
>>
>> before sending the output to the client?
> 
> 
> That sounds exactly like the incantation I needed.
> 
> But I can’t get it to work.
> 
> The first 3 lines of my webPage.lc <http://webpage.lc/> file are
> 
> <!doctype html>
> <?lc put header "Content-Type: text/html; charset=" & quote & "UTF-8" & quote ?>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> 
> (Not sure that 3rd line is necessary with HTML5, but presumably it couldn’t hurt)
> 
> The header suggested just seems to be ignored when LC Server sends the output to Apache.  (Tried it with “put new header…” too after I found some documentation for the magic spell.)
> 
> The default setting for Apache on Dreamhost is naturally the native encoding ISO-8859-1.(Is there any way to override that with htaccess, since all my WordPress pages are served as utf-8 already?)
> 
> Neville Smythe





More information about the use-livecode mailing list