Re: Encoding Problem

Raphael Ritz <[email protected]>
Newsgroups gmane.comp.web.zope.german
Message-ID <[email protected]>
[email protected] wrote:
> 
> Ich glaube ich komme dem Problem so langsam auf die Schliche.
> 
> Abhängig vom Namen bekomme ich ISO-8859-15 codierte Ergebnisse vom 
> LDAP-Server zurück und manchmal UTF-8. Firefox scheint diesbezüglich 
> tolerant zu sein und stellt auch gemischte Kodierungen korrekt dar, 
> wohingegen IE nur eins von beiden korrekt darstellt.
> 
> Ich muß leider blöd fragen... Gibt es eine Möglichkeit die 
> LDAP-Ergebnisse so umzuwandeln, dass sie immer UTF-8-codiert sind?
> 

Vielleicht hilft Dir folgendes auf die Spruenge:

 >>> us = u"Blöd"
 >>> s_l1 = us.encode('latin-1')
 >>> s_u8 = s_l1.decode('latin1').encode('utf-8')
 >>> s_u8
'Bl\xc3\xb6d'
 >>> s_l1
'Bl\xf6d'

u.s.w.

Raphael


> 
> [email protected] wrote on 05/05/2009 11:03:02 AM:
> 
>  > On 05.05.09 11:00, [email protected] wrote:
>  > >
>  > > Zu früh gefreut :(. Leider galt das nur für den Firefox. Im IE krieg
>  > > ich das ursprüngliche Problem... muß ich noch irgendwas beachten? IE
>  > > verwendet schon das richtige Encoding, aber zeigt trotzdem falsche
>  > > Zeichen an (wie eingangs geschildert).
>  >
>  >
>  > Das mag ich nicht glauben. Alle IE Versionen interpretieren
>  > normalerweise den content-type HTTP Header inkl. 'charset' Definition
>  > korrekt.
>  >
>  > Andreas
>  >
>  >
>  > _______________________________________________
>  > zope mailing list
>  > [email protected]
>  > https://mail.dzug.org/mailman/listinfo/zope
> 
> 
> ------------------------------------------------------------------------
> 
> 
> 
> _______________________________________________
> zope mailing list
> [email protected]
> https://mail.dzug.org/mailman/listinfo/zope



_______________________________________________
zope mailing list
[email protected]
https://mail.dzug.org/mailman/listinfo/zope
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.