|
From: Chris N. <pu...@po...> - 2001-03-30 15:15:57
|
At 14:42 +0200 2001.03.30, Stefan Strigler wrote:
>On Fri, Mar 30, 2001 at 03:19:04PM +0300, Alessio Bragadini wrote:
>>
>> One of the point of Slash is to have less-computer-literated people work
>> with the system with no troubles. Asking them to change characters they
>> have on their keyboard with HTML entities is not very popular and
>> probably not useful. Is it possible/reasonable to have a conversion from
>> special chars to entities built in the admin interface?
>
>Using HTML::Entities all this is no problem at all (despite the work to
>use it consistently ... ;-) ).
>Just do a decode_entities() followed by a encode_entities() for every
>text-input.
>Sure it would be better to *not* store HTML-entities in the DB. With
>encode_entities() you could generate them everytime some text from the
>db ist to be sent over HTTP.
It is just one extra complication we didn't get around to doing. On the
one hand it seems easy, but on the other ... what if the encoding for your
site ALLOWS these characters? Then maybe you wouldn't want them encoded.
It could be a preference, of course, but I hope you can see why it isn't as
easy as just doing a conversion on submission.
>But all of this doesn't have to do anything with the problem I have:
>encode_entities() can't convert UTF-8 encoded strings :-(
Where do you have a UTF-8 string?
>And I still think that XML::Parser returns all strings in UTF-8 after
>doing a parse() regardless the encoding of the strings before.
I am pretty sure it just returns raw data. If you put in a u with an
umlaut (Latin-1 character 252), then that is what you should get in return.
#!/usr/bin/perl -wl
use XML::RSS;
$x = XML::RSS->new(encoding=>"ISO-8859-1");
$y = XML::RSS->new(encoding=>"ISO-8859-1");
$x->channel(title => chr(252));
$y->parse($x->as_string);
print ord $y->{channel}{title};
Returns:
252
That's just Latin-1. There's no UTF-8 string there.
>If you still don't believe have a look at http://wurbel.spline.de and
>select the "Heise Newsticker"-box from "Benutzeraccount" on the left.
I can't find anything like that on the site; it might not help that I don't
speak German.
--
Chris Nandor pu...@po... http://pudge.net/
Open Source Development Network pu...@os... http://osdn.com/
|