Thanos Chatziathanassiou wrote:
I have an interesting problem with UTF-8 charset and Apache::ASP (possibly):

I had to construct some xml with Apache::ASP some time ago, but due to a switch, I now want the resulting file to be UTF-8 encoded instead of ISO-8859-7 that it was until now.
This is all fine, however the data I'm reading from the database are also in ISO-8859-7.
So I used Script_OnFlush like this:


$$ref =~ s|([\xB8-\xFE])|chr(ord($1)+0x02D0)|sge;
(BTW I also tried ``use Encode;'' and ``use encoding "iso-8859-7";'' of perl-5.8 with quite the same results)
in order to convert all greek characters from iso-8859-7 to utf-8 just before flushing the output to the client.


The problem is that although I can verify that $$ref contains what I want (I also printed it to a file just to make sure), the output to any client (Mozilla, Opera, IE, XML Spy, whatever) is truncated and obviously not valid.
I've actually used Ethereal to sniff the data on the network and they seem to be valid and the charset checks out ok.



Maybe the Content-Length field is not calculated correctly by Apache::ASP? If its too short, this could be a problem. To have Apache::ASP not calculate the content length, try to flush when the script first starts, that will flush the headers, and see if there is a difference.

Regards,

Josh

________________________________________________________________________
Josh Chamas, Founder    | NodeWorks - http://www.nodeworks.com
Chamas Enterprises Inc. | NodeWorks Directory - http://dir.nodeworks.com
http://www.chamas.com   | Apache::ASP - http://www.apache-asp.org



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to