Gentoo Archives: gentoo-user

From: n952162 <n952162@×××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] python3 question
Date: Wed, 13 Jan 2021 18:57:44
Message-Id: 63ec2fc0-139c-21b9-ce9c-a158b35ffb86@web.de
In Reply to: [gentoo-user] python3 question by n952162
1 On 1/13/21 7:31 PM, n952162 wrote:
2 > Hello.  In python3, how do you do this?
3 >
4 > tgt = 'gebuchte Umsätze;'
5 >
6 > In python2, you could do this:
7 >
8 > tgt = unicode ('gebuchte Umsätze;'.decode ('latin1'))
9 >
10 > but that gives:
11 >
12 > SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xe4 in
13 > position 12: invalid continuation byte
14 >
15 > In fact, any constant with ä in it will give you that.
16 >
17 >
18
19 Okay, I see that if your locale is not C, you can do:
20
21 tgt = 'gebuchte Umsätze;'

Replies

Subject Author
Re: [gentoo-user] python3 question n952162 <n952162@×××.de>