xuv's notebook

Side notes, howtos and random bits of information related to Julien Deswaef's activities

User Tools

Site Tools


os:arch:arch_on_the_pi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
os:arch:arch_on_the_pi [2026/09/22 14:46] – [Installing ikiwiki] Julien Deswaefos:arch:arch_on_the_pi [2026/09/22 14:46] (current) – [Python UnicodeEncodeError horror] Julien Deswaef
Line 132: Line 132:
 So your Python script works on your machine. But when you port it to a freshly installed Arch Linux Arm on a Pi, all hell breaks loose as soon as a weird character pops up. Something like this shows up:  So your Python script works on your machine. But when you port it to a freshly installed Arch Linux Arm on a Pi, all hell breaks loose as soon as a weird character pops up. Something like this shows up: 
 <code>UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 227: ordinal not in range(128)</code> <code>UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 227: ordinal not in range(128)</code>
-Well, don't start modifying your Python code (as you said, it does not have that problem on your machine).  It's because the default locale of Arch Linux is ''LANG-C'' and what you want is UTF-8 support. There is many ways to solve this, including forcing Python to use a locale different from the system. But I like to have my systems with similar settings. So just follow tutorials [[https://wiki.archlinux.org/index.php/Locale|here]].+Well, don't start modifying your Python code (as you said, it does not have that problem on your machine).  It's because the default locale of Arch Linux is `LANG-C` and what you want is UTF-8 support. There is many ways to solve this, including forcing Python to use a locale different from the system. But I like to have my systems with similar settings. So just follow tutorials [[https://wiki.archlinux.org/index.php/Locale|here]].
  
os/arch/arch_on_the_pi.1790081179.txt.gz · Last modified: by Julien Deswaef