469,647 Members | 1,863 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,647 developers. It's quick & easy.

unicode in multi-line strings

Hello,

I have a problem with international characters in multi-line strings.
Works: '''á'''

Works: '''
a'''

Does not work: '''
á'''
By does not work I mean the infamous

'ascii' codec can't encode character u'\xe1' in position 4: ordinal not
in range(128)

I'm using Ubuntu 8.04 with Python 2.5. It does not work in terminal,
from scripts, or from scripts with the encoding specified at the top.
Making the string unicode (u''' ... ''') does not change anything.

It could be an interpreter issue but I didn't know where else I should
turn for help.

Thank you!
Jiri
Sep 18 '08 #1
1 3242
Jiri Barton wrote:
Hello,

I have a problem with international characters in multi-line strings.
Works: '''á'''

Works: '''
a'''

Does not work: '''
á'''
By does not work I mean the infamous

'ascii' codec can't encode character u'\xe1' in position 4: ordinal not
in range(128)

I'm using Ubuntu 8.04 with Python 2.5. It does not work in terminal,
from scripts, or from scripts with the encoding specified at the top.
Making the string unicode (u''' ... ''') does not change anything.

It could be an interpreter issue but I didn't know where else I should
turn for help.
Please show a self-contained example that does not work. The above won't
puke on you as you claim - because they are simple byte-strings, and thus
aren't subject to any automatic en/decoding whatsoever, unless somehow
*used*. Which you don't show how you do it.

Diez
Sep 18 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Basil | last post: by
6 posts views Thread by New MSSQL DBA | last post: by
reply views Thread by Douglas Lochart | last post: by
17 posts views Thread by =?Utf-8?B?R2Vvcmdl?= | last post: by
5 posts views Thread by =?Utf-8?B?amM=?= | last post: by
8 posts views Thread by Yves Dorfsman | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.