Htmltext and latin-1 characters
2006-05-10
Mike OrrRe: [Cheetahtemplate-discuss] Htmltext and latin-1
characters
2006-05-10
Ian BickingRe: [Cheetahtemplate-discuss] Htmltext and
latin-1 characters
2006-05-11
David BingerRe: [Cheetahtemplate-discuss] Htmltext and latin-1
characters
2006-05-10
Mike Orr2006-05-11
David Binger2006-05-11
Mike Orr2006-05-11
David Binger2006-05-11
David Binger2006-05-11
David Binger2006-05-13
Akihiro KAYAMA2006-05-13
Mike Orr2006-05-15
Akihiro KAYAMARe: Htmltext and latin-1 characters
2006-06-04
Neil Schemenauer2006-06-04
ak (2 parts)2006-06-06
Akihiro KAYAMARe: Htmltext and latin-1 characters
2006-06-05
Neil Schemenauer2006-06-05
Akihiro KAYAMA2006-06-05
Neil Schemenauer2006-06-05
Mike Orr2006-06-06
Neil Schemenauer2006-06-05
Mike OrrHtmltext and latin-1 characters
David Binger
On May 10, 2006, at 5:15 PM, Mike Orr wrote:
> return unicode(val.s, 'latin1') # Cheetah > 1.0rc1 compatibility.
>
> TypeError: decoding Unicode is not supported
This happens to be a case where the htmltext object is
wrapping a unicode instance. In a case like that, you
just want val.s if you want the unicode instance.
>
> How about this?
>
> return unicode(val.s) # Cheetah > 1.0rc1 compatibility.
>
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in
> position 412: ordinal not in range(128)
Is something calling str() on this return value?
Something not shown here is trying to encode
a str from the unicode instance.
>
> F**k! OK, the trick I used in TurboGears:
>
> return unicode(val.s, 'latin1').encode('latin1') # Cheetah >
> 1.0rc1 compatibility.
>
> TypeError: decoding Unicode is not supported
This looks like the val.s is already a unicode.