You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Hartmaier Alexander <Al...@t-systems.at> on 2006/01/12 16:58:46 UTC

UTF-8 problems with links

Hi list!

It seems that since the upgrade to embperl 2.1 a bug has been introduced when 
generating links and using utf-8.
I have for example this code in one of my embperl pages:

<a 
href="add-record.epl?table=raduser&amp;subtable=raduser_dialin&amp;defval_fk_radaccesstype=1&amp;defval_fk_division=[+ 
$fk_division +]&amp;defval_clientname=[+ $cli
entname +]&amp;defval_zip=[+ $zip +]&amp;defval_city=[+ $city 
+]&amp;defval_street=[+ $street +]&amp;defval_phone=[+ $phone 
+]&amp;defval_fk_radacct_dialin=[+ $fk_radacct_dialin +
]&amp;ignore=fk_radaccesstype">Add similar</a>

If a var inserted with [+ +] contains a german 'Umlaut' or a 'sharp S' the 
link isn't ok (or maybe the handling of the encoded cgi var...).

Gerald can you help?

-Alex



RE: UTF-8 problems with links

Posted by Gerald Richter <ri...@ecos.de>.
Hi,

> 
> It seems that since the upgrade to embperl 2.1 a bug has been 
> introduced when generating links and using utf-8.
> I have for example this code in one of my embperl pages:
> 
> <a
> href="add-record.epl?table=raduser&amp;subtable=raduser_dialin
&amp;defval_fk_radaccesstype=1&amp;defval_fk_division=[+
> $fk_division +]&amp;defval_clientname=[+ $cli entname 
> +]&amp;defval_zip=[+ $zip +]&amp;defval_city=[+ $city 
> +]&amp;defval_street=[+ $street +]&amp;defval_phone=[+ $phone 
> +]&amp;defval_fk_radacct_dialin=[+ $fk_radacct_dialin +
> ]&amp;ignore=fk_radaccesstype">Add similar</a>
> 
> If a var inserted with [+ +] contains a german 'Umlaut' or a 
> 'sharp S' the link isn't ok (or maybe the handling of the 
> encoded cgi var...).
> 

Since 2.1 Embperl honours Perl's UTF-8 Flag (see
http://perl.apache.org/embperl/pod/doc/Embperl.-page-12-.htm)

So in case your variables has the UTF-8 Flag set and it isn't UTF-8
something might go wrong.

You can check if your variable has the UTF-8 set with the module
Devel::Peek.

You can turn the UTF-8 flag on and off with Encode::_utf8_on/off, but you
should know what your are doing to not create more confusion.

If this all seems to be correct, it would be great if you can create a small
example which reproduces the error

Gerald


 
** Virus checked by BB-5000 Mailfilter ** 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org