On 2021-01-13, n952162 <n952...@web.de> wrote:

> Hello. In python3, how do you do this?

Please explain what "this" is trying to accomplish, and we can tell
you how to do it in Python3. Are you trying to convert from Unicode to
Latin1 and back to Unicode?

  Python 3.8.6 (default, Jan  2 2021, 20:25:58)
  [GCC 9.3.0] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  >>> 'gebuchte Umsätze;'.encode('latin1').decode('latin1')
  'gebuchte Umsätze;'


> tgt = 'gebuchte Umsätze;'
>
> In python2, you could do this:
>
> tgt = unicode ('gebuchte Umsätze;'.decode ('latin1'))
>
> but that gives:
>
> SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xe4 in
> position 12: invalid continuation byte
>
> In fact, any constant with ä in it will give you that.



Reply via email to