How to concatenate unicode strings ???
clp2 at rebertia.com
Tue Apr 26 18:07:16 CEST 2011
On Tue, Apr 26, 2011 at 8:58 AM, Ariel <isaacrc82 at gmail.com> wrote:
> Hi everybody, how could I concatenate unicode strings ???
> What I want to do is this:
> unicode('this an example language ') + unicode('español')
> but I get an:
> Traceback (most recent call last):
> File "<console>", line 1, in <module>
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 11:
> ordinal not in range(128)
> How could I concatenate unicode strings ???
That error is from the 2nd call to unicode(), not from the
concatenation itself. Use proper Unicode string literals:
u'this an example language ' + u'español'
You'll probably also need to add the appropriate source file encoding
declaration; see http://www.python.org/dev/peps/pep-0263/
More information about the Python-list