"dà © jà vu" ----> "déjà-vu" (='.'=)

Are you using LiveCode to create server scripts or CGIs?

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Posts: 218
Joined: Tue May 07, 2013 9:38 pm

Re: "dà © jà vu" ----> "déjà-vu" (='.'=)

Post by Mariasole » Wed Jun 15, 2016 1:44 pm

Hi LCMark!
Thank you for having taken time to reflect on my problem. :)
Also I have read carefully what you suggested, and I was inspired to learn new techniques, including the "rewrite" on Apache! :D

I will try to be clear, I know you'll excuse me for my uncertain English syntax! :?

You are perfectly centered the problem: I want some files with extension .html would live together. In fact in them some will be "dynamic" (ie LCS inside), and other are "classic" (ie static).

What I wish is that both the souls (static and dynamic) lived under LCS.

Unfortunately, there is the problem that LCS transforms static .htm file, from UTF-8 to iso-8859-1. :shock:

If LCS not change the pages to become iso-8859-1 there would be no problems!

You're right when you say that it would be better to handle static files to Apache, but I need an interim solution.

Gradually the "static" files would be converted into file "dynamic" manually.

Here we are all craftsmen, worked with wood, marble, we do things a piece at a time! :wink:

The need was to start somewhere with the "dynamism" and then continue it gradually.

I understand what you explained to me by the "rewrite"! It 'very interesting and I began to study it. I think it does not cause problems even for search engines. Although I'll have to investigate. In fact it is now the only possible solution to enter the "dynamic" file in my hybrid site...

Although I did not understand everything, I believe that the problem described on ' "obscure" Bug 17244 is similar to my problem.

LCS "takes" a file and imposes its ecode, the legendary iso-8859-1! All the rest is paved! :cry:

It would be nice to have control of some of LCS global parameters (including the encoding!!!) via .htaccess, in order to make this wonderful software even more powerful and flexible. :wink:

Thank you so much for your response, it was very useful!

No input, no output. Man - Joe Strummer
Garbage in, garbage out (GIGO) - anonymous

Peter Wood
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 92
Joined: Mon Jul 06, 2009 4:53 am
Location: Bamboo River

Re: "dà © jà vu" ----> "déjà-vu" (='.'=)

Post by Peter Wood » Sun Aug 07, 2016 1:30 am

Adding this to your LiveCode script will get it to output UTF-8

Code: Select all

set the outputTextEncoding to "utf8"

VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 228
Joined: Mon May 18, 2009 4:12 am

Re: "dà © jà vu" ----> "déjà-vu" (='.'=)

Post by wsamples » Mon Aug 08, 2016 9:12 am

Having LiveCode Server read and adjust certain settings according to a file could be a useful feature request. There is a forum here for that and you can also do it here: http://quality.livecode.com/ choosing "Feature enhancement" from the option menu. Since the aim is to provide flexibility, maybe a plain text file located somewhere LC Server can locate it would be a more universally useful format than .htaccess.

If you have shell access to your server account and 'find' and 'sed' are installed, you can add the header line to your html files very simply. Replace "/full/path/to/htdocs" with the correct path to your html directory:

Code: Select all

find /full/path/to/htdocs -name '*.html' -exec sed -i '1i put header "Content-Type: text/html; charset=utf-8"' {} \;
This will find all .html files starting at your server root including in its subdirectories and add the necessary header at the top of each file.

Post Reply

Return to “CGIs and the Server”