You are not logged in.

#1 2023-11-01 08:09:49

0505Oryon
Member
Registered: 2012-02-05
Posts: 25

UnicodeEncodeError error in python codes

Hi! I am completely new with arch, but I am enjoying it so far, however I have a strange error in my python codes, which might completely be unrelated to arch, but it does not happen on my other linux machines (mostly Ubuntu).

I am Hungarian, and have a lot of strange characters like áéűúőóüö etc. Now these characters appear a lot in my python code. I use PyCharm as an editor, and on my Ubuntu machines these characters are treated/displayed perfectly.

On my arch machine however I get errors like:

UnicodeEncodeError: 'ascii' codec can't encode character '\xfa' in position 5: ordinal not in range(128)

I know I can use .encode() to avoid this error, however that renders the string like this:

b'[["V\xc3\xb6lgyid\xc5\x91s jegy",2900,53],["Cs\xc3\xbacsid\xc5\x91s jegy",3500,11],["Cs\xc3\xbacsid\xc5\x91s jegy",3500,11]]'

which is more or less unreadable.

If this is related to arch, how can I fix this?

If it is unrelated, I am sorry for being and idiot...

Last edited by 0505Oryon (2023-11-01 08:10:28)

Offline

#2 2023-11-01 14:27:13

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,097

Re: UnicodeEncodeError error in python codes

post output of

localectl;locale -a;locale

Last edited by Mr.Elendig (2023-11-01 14:28:15)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

Board footer

Powered by FluxBB