> Well, the if no encoding is declared, it (quite sensibly) assumes UTF-8,
> so for my purposes this boils down to using a UTF-8 editor -- which I
> always do anyway. But do I still have to put a "u" before my string
> literals in order to have it treated as characters rather than bytes?
Yes.
>
On Oct 18, 2008, at 1:20 AM, Martin v. Löwis wrote:
Do you then have a proper UTF-8 string,
but the problem is that none of the standard Python library methods
know
how to properly interpret UTF-8?
There is (probably) no such thing as a "proper UTF-8 string" (in the
sense in which you proba
On Oct 17, 2:38 pm, Joe Strout <[EMAIL PROTECTED]> wrote:
> Thanks for the answers. That clears things up quite a bit.
>
> >> What if your source file is set to utf-8? Do you then have a proper
> >> UTF-8 string, but the problem is that none of the standard Python
> >> library methods know how to
> 2. Exactly what Unicode you get would be dependent on Python properly
> interpreting the bytes in the source file -- which you can make it do by
> adding something like "-*- coding: utf-8 -*-" in a comment at the top of
> the file.
That depends on the Python version. Up to (and including) 2.4, t
Thanks for the answers. That clears things up quite a bit.
What if your source file is set to utf-8? Do you then have a proper
UTF-8 string, but the problem is that none of the standard Python
library methods know how to properly interpret UTF-8?
Well, the decode method knows how to decode t
On Fri, 17 Oct 2008 11:32:36 -0600, Joe Strout wrote:
> On Oct 17, 2008, at 11:24 AM, Marc 'BlackJack' Rintsch wrote:
>
>>> kw = 'генских'
>>>
>> What do you mean by "does not work"? And you are aware that the above
>> snipped doesn't involve any unicode characters!? You have a byte
>> string t
On Oct 17, 2008, at 11:24 AM, Marc 'BlackJack' Rintsch wrote:
kw = 'генских'
What do you mean by "does not work"? And you are aware that the above
snipped doesn't involve any unicode characters!? You have a byte
string
there -- type `str` not `unicode`.
Just checking my understanding he
On Fri, 17 Oct 2008 13:07:38 -0400, gita ziabari wrote:
> The following code does not work for unicode characters:
>
> keyword = dict()
> kw = 'генских'
> keyword.setdefault(key, []).append (kw)
>
> It works fine for inserting ASCII character. Any suggestion?
What do you mean by "does not work"
Hello All,
The following code does not work for unicode characters:
keyword = dict()
kw = 'генских'
keyword.setdefault(key, []).append (kw)
It works fine for inserting ASCII character. Any suggestion?
Thanks,
Gita
--
http://mail.python.org/mailman/listinfo/python-list