Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] unicode and Perl- how to pass command line unicodearguments
- Date: Tue, 14 Feb 2006 12:17:09 +0100
- From: =?UTF-8?B?R8OhYm9yIEZhcmthcw==?= <gabor@example.com>
- Subject: Re: [tlug] unicode and Perl- how to pass command line unicodearguments
- References: <43EFF8C4.4050704@example.com> <87d5hrix3v.fsf@example.com> <43F0D507.7020303@example.com><87d5hqhcxe.fsf@example.com>
- User-agent: Mozilla Thunderbird 1.0.7 (X11/20051013)
Stephen J. Turnbull wrote: >>>>>>"gabor" == gabor <gabor@example.com> writes: > > > gabor> in python byte-strings are objects and unicode-strings are > gabor> objects too. you create a byte string for example like > gabor> this: > > gabor> string1 = "byte string" > > Unfortunately, "これは日本語です。" will produce a string which is > encoded Japanese (with whatever encoding the file is saved in), but > > gabor> string2 = u"byte string" > > u"これは日本語です。" does not produce Unicode-encoded Japanese. It > may work with PEP 263 coding cookies, but this is unreliable in the > Japanese environment (because of the multiplicity of incompatible > encodings). could you explain this part to me? why is your own source-code unreliable? :) for example, this works fine: ======= #!/usr/bin/python # -*- coding: utf-8 -*- text = u"これは日本語です" print len(text) ======== the output is 8. > I argued strenuously for an XML-like "default to UTF-8" policy with > optional codecs for loading Python code, but Guido refused on the > basis of backward compatibility (ie, lots of Europeans were using 8 > bit encodings in existing production code). > hmm.. i would also prefer to use utf8 as the default instead of ascii.. btw. even for people who use latin-1, it does not help. without that pep263-setting, auto-converting a latin-1 bytestring to unicode will end with an exception. gabor
- Follow-Ups:
- Re: [tlug] unicode and Perl- how to pass command line unicodearguments
- From: Stephen J. Turnbull
- References:
- Re: [tlug] unicode and Perl- how to pass command line unicodearguments
- From: David Riggs
- Re: [tlug] unicode and Perl- how to pass command line unicodearguments
- From: Stephen J. Turnbull
- Re: [tlug] unicode and Perl- how to pass command line unicodearguments
- From: gabor
- Re: [tlug] unicode and Perl- how to pass command line unicodearguments
- From: Stephen J. Turnbull
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Japanese dictionaries
- Next by Date: Re: [tlug] unicode and Perl- how to pass command line unicodearguments
- Previous by thread: Re: [tlug] unicode and Perl- how to pass command line unicodearguments
- Next by thread: Re: [tlug] unicode and Perl- how to pass command line unicodearguments
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links