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
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 = '
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
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