Page 1 of 3
déjà vu (='.'=) [LiveCodeServer]
Posted: Tue May 24, 2016 1:19 pm
by Mariasole
I'm doing one of my experiments!
LC Server unfortunately adopts as the default charset output the "iso-8859-1".
So if I put on server a simple html page* that says "deja-vu", the LC server will restore me as "dà © jà vu".
Now, it is easy to "correct", I need to put this script in
every page:
Code: Select all
put header "Content-Type: text/html; charset=utf-8"
But if I have a thousand pages, I can tell the LC server maybe
via .htaccess to output in UTF8 and not in "iso-8859-1"?
Many thanks for your help!
Mà rìà sòlè
(='.'=)
* LiveCodeServer works in my .htaccess with ext: .htm/.html/.lc/ .rev
Re: déjà vu (='.'=)
Posted: Tue May 24, 2016 1:33 pm
by Lagi Pittas
Hi Mariasole
short answer:
Long answer ...
A particularly erudite exposition from w3
https://www.w3.org/International/questi ... charset.en
Lagi
Re: déjà vu (='.'=) [LiveCodeServer]
Posted: Tue May 24, 2016 1:56 pm
by Mariasole
Thanks Lagi for your support!
Unfortunately it does not work ...
I've also tried to put that kind of string. That's why I asked the question.
Here is my configuration of
.htaccess:
Code: Select all
AddCharset UTF-8 .htm ---> don't work
#AddCharset utf-8 .lc .irev .html .htm ---> don't work
#AddDefaultCharset utf-8 ---> don't work
AddHandler livecode-script .lc .irev .html .htm
Action livecode-script /cgi-bin/livecode-community-server
Here is my html file:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Déjà vu</title>
</head>
<body>
Déjà vu
</body>
</html>
And here's the result!
Déjà vu
How can it be done?
again...
Mà rìà sòlè
(='.'=)
Re: déjà vu (='.'=) [LiveCodeServer]
Posted: Tue May 24, 2016 4:03 pm
by Lagi Pittas
Hi
How about trying
Code: Select all
<FilesMatch "\.(htm|html|css|js|rev|livecode|lc|irev)$">
ForceType 'text/html; charset=UTF-8'
</FilesMatch>
in the .htaccess
If it doesn't work. We'll try a different tack. I am upto my ears on a project at the moment so can't spend time to test it.
Lagi
Re: déjà vu (='.'=) [LiveCodeServer]
Posted: Tue May 24, 2016 4:09 pm
by Mariasole
Thank you Lagi!
Grazie mille per il tuo prezioso tempo!
AddCharset UTF-8 .htm --->
don't work
AddCharset utf-8 .lc .irev .html .htm --->
don't work
AddDefaultCharset utf-8 --->
don't work
Mà rìà sòlè
(='.'=)
Re: déjà vu (='.'=) [LiveCodeServer]
Posted: Tue May 24, 2016 4:27 pm
by Lagi Pittas
Did you try?
Code: Select all
<FilesMatch "\.(htm|html|css|js|rev|livecode|lc|irev)$">
ForceType 'text/html; charset=UTF-8'
</FilesMatch>
Otherwise maybe your htaccess is not being recognised for some reason.
It Happens
lagi
Re: déjà vu (='.'=) [LiveCodeServer]
Posted: Tue May 24, 2016 6:58 pm
by ghettocottage
Tested on my server and have the same results: .htaccess does not seem to affect the charset of livecode, but using
Code: Select all
put header "Content-Type: text/html; charset=utf-8"
works.
However, my PHP files obey the charset of .htaccess, so it is working, just not with Livecode>
But if I have a thousand pages, I can tell the LC server maybe via .htaccess to output in UTF8 and not in "iso-8859-1"?
Many thanks for your help!
Maybe a different approach would be to just have one header file that you include in all of your other files?
Re: déjà vu (='.'=) [LiveCodeServer]
Posted: Tue May 24, 2016 7:01 pm
by Mariasole
Hi Lagi,
Thank you so much for your interest.
I'm very grateful.
Unfortunately, the "forcing" does not work!
I think it does not depend on my Apache, I did try the strings from a friend and he too has the same result!
The fact that the page is "taking charge" and then "released" from LC Server at each call, probably deprives Apache.
Will there be a solution?
Mà rìà sòlè
(='.'=)
Re: déjà vu (='.'=) [LiveCodeServer]
Posted: Tue May 24, 2016 7:13 pm
by Mariasole
Thanks ghettocottage!
Thanks for trying.
Put the small script clearly works,
but I was looking for a "hybrid" solution.
Imagine this situation.
An old site, but beautiful, made with painstaking care page by page that now has decided to have some html "powered by LiveCodeServer". On the server, mandatory extension ".html", have to live the old html with the html "LC powered."
The solutions are three:
a) can not coexist
b) to parse all "old" pages with Code: Select all
put header "Content-Type: text/html; charset=utf-8"
or
c) put on htaccess a code to see all pages in utf8 (the "powered" pages and the "old" pages).[/b]
I do not know if I could explain!
Thanks!!!!!!!!!!!!
Mà rìà sòlè
(='.'=)
Re: déjà vu (='.'=) [LiveCodeServer]
Posted: Wed May 25, 2016 10:55 am
by Mariasole
There is a
guru of LiveCode Server that could help me?
I understand it's not as exciting as a widget, but this problem could be interesting ...
Grazie a tutti!
Mà rìà sòlè
(='.'=)
Re: déjà vu (='.'=) [LiveCodeServer]
Posted: Wed May 25, 2016 4:35 pm
by Mariasole
I had an idea.
It is possible to pass a "preference" to LiveCodeServer to tell it to output "UTF8" instead of "iso-8859-1" via .htaccess?
Thanks for the many who are interested in my problem! And for the general enthusiasm for LC Server!
Mà rìà sòlè
(='.'=)
Re: déjà vu (='.'=) [LiveCodeServer]
Posted: Wed May 25, 2016 4:55 pm
by ghettocottage
Mariasole wrote:I had an idea.
It is possible to pass a "preference" to LiveCodeServer to tell it to output "UTF8" instead of "iso-8859-1" via .htaccess?
Thanks for the many who are interested in my problem! And for the general enthusiasm for LC Server!
Mà rìà sòlè
(='.'=)
I was wondering the same thing, but not necessarily using the .htaccess. I wonder if there is a way to have a config file for LivecodeServer to set/change some defaults.
Re: déjà vu (='.'=) [LiveCodeServer]
Posted: Wed May 25, 2016 5:15 pm
by FourthWorld
1. Which version of LiveCode are you using?
2. Do you really want HTML pages to be processed with LiveCode in addition to .lc files?
Re: déjà vu (='.'=) [LiveCodeServer]
Posted: Wed May 25, 2016 6:20 pm
by Mariasole
Hi Richard!
1. LCS 8.0.1
2. Yes, I am very sure, for the reasons I write before ...
Thanks!
Mà rìà sòlè
(='.'=)
Re: déjà vu (='.'=) [LiveCodeServer]
Posted: Wed May 25, 2016 6:23 pm
by FourthWorld
Re. #2: I asked because you mentioned that many (most?) of those HTML pages are static, exiting in complete form prior to using LC Server. What is it you want LC Server to do with those?