encoding problem

2008-12-19 Thread digisat...@gmail.com
The below snippet code generates UnicodeDecodeError. #!/usr/bin/env python #--*-- coding: utf-8 --*-- s = 'äöü' u = unicode(s) It seems that the system use the default encoding- ASCII to decode the utf8 encoded string literal, and thus generates the error. The question is why the Python interpre

Re: encoding problem

2008-12-19 Thread digisat...@gmail.com
On 12月19日, 下午9时34分, Marc 'BlackJack' Rintsch wrote: > On Fri, 19 Dec 2008 04:05:12 -0800, digisat...@gmail.com wrote: > > The below snippet code generates UnicodeDecodeError. > > #!/usr/bin/env > > python > > #--*-- coding: utf-8 --*-- > > s = '

expandtabs acts unexpectedly

2009-08-19 Thread digisat...@gmail.com
Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) [GCC 4.3.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> ' test\ttest'.expandtabs(4) ' test test' >>> 'test \ttest'.expandtabs(4) 'testtest' 1st example: expect returning 4 spaces between 'test', 3

Re: expandtabs acts unexpectedly

2009-08-19 Thread digisat...@gmail.com
On Aug 19, 4:16 pm, Peter Brett wrote: > "digisat...@gmail.com" writes: > > Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) > > [GCC 4.3.3] on linux2 > > Type "help", "copyright", "credits" or "license" for