Re: Python3 UTF-8 file encoding error

"Bruce Dubbs" ([email protected] via blfs-dev Mailing List) <[email protected]> Sun, 28 Dec 2025 10:23:38 -0600
Newsgroups gmane.linux.lfs.beyond.devel
Message-ID <[email protected]>
On 12/28/25 8:24 AM, Jamenson Espindula ([email protected] via blfs-dev Mailing List) 
wrote:
> Hi all.
> 
> Output of the command <file os-release>:
> os-release: ISO-8859 text
> 
> Output of the command <cat os-release>:
> NAME="GNU + Linux From Scratch"
> VERSION="12.2"
> ID=lfs
> PRETTY_NAME="GNU + Linux Oriundo de C�digo Fonte"
> VERSION_CODENAME="Jamenson Espindula"
> HOME_URL="https://www.linuxfromscratch.org/lfs/"
> 
> Pay attention to the 'PRETTY_NAME' field: it holds a UTF-8 accented character.

[snip]

>   = = = Transcription ends = = =
> 
> As you can see ('release_file'), the Python extractor had problems
> with the file '/etc/os-release'.
> 
> That issue is easily solvable running the following commands (as 'root' user):
> 
> cd /etc/
> mv -v os-release os-release-iso8859-1
> iconv -f ISO-8591-1 -t UTF-8 < os-release-iso8859-1 > os-release
> 
> I believe it is helpful (especially for people outside North American)
> to include such information in the BLFS book or another suitable
> place.

You should add that to your version of the translated book.  The only reason for the 
issue is because of the particular translation.  I do not see a problem with that 
customization in your particular circumstances.

   -- Bruce

-- 
http://lists.linuxfromscratch.org/sympa/info/blfs-dev
Unsubscribe: See the above information page