Restore support for Latin1 file names on openSUSE Leap 16

While openSUSE Leap 15.3 (and maybe also later 15.x versions) was still based on Qt5, and therefore had no problem supporting file names encoded in iso8859-1 (a.k.a. Latin1) or even other single byte character sets, Leap 16.0 switched to Qt6, which now enforces the use of "UTF-8 everywhere".

I try to use 7-bit ASCII wherever possible, so I write everything in English, which saves me from all the trouble with character sets. However, since my native language is German, there are occasions where I like/need to name a file or directory with German umlauts (like "München"), and I don't want to have them encoded in UTF-8. Plain old iso8859-1 is fully sufficient for me. Let's not even get into the hoops you have to jump through in Perl just to deal with UTF-8.

Thankfully the important functions to convert from Qt's internal character representation (which is UTF-16) to the underlying file system's character set (which can be UTF-8, but may as well be iso8859-1 or any other single byte set) are still there, so patching Qt6 is pretty straightforward. Unfortunately Qt6 has apparently removed all but Latin1 character sets, but at least for my purposes this is sufficient.

Download

GIT archive

The official GIT archive is hosted at

https://git.tvdr.de

Use the command

git clone --branch stable/latest git://git.tvdr.de/suse-leap-latin1.git

to clone the archive and check out the latest stable version.

ZIP archive

The source code for the latest version can be downloaded from

https://git.tvdr.de/?p=suse-leap-latin1.git;a=snapshot;h=stable/latest;sf=zip

The patch

This patch modifies three source files of Qt6:

Usage

The script file suse-leap-latin1-build that comes with this patch does all the work necessary to build a patched version of the Qt6 library file libQt6Core.so.6.9.1. You may want to run this on a fresh installation of openSUSE Leap 16.0, preferably on a virtual machine (to not pollute your system with software packages you won't need later). Make sure your VM has at least 16GB of RAM, otherwise the build process may run out of memory.

Copy the files

  suse-leap-latin1-build
  0002-Restore-Latin1-for-file-names.patch
into a new directory. Change into that directory and execute the script. When prompted for decisions type either 'y' (yes) or 'n' (no) and hit enter. If the script finishes successfully there should be a file named libQt6Core.so.6.9.1, which replaces the original file in /usr/lib64. After replacing the library file you should reboot your system.

Enable Latin1 support

To enable Latin1 support you should do the following:

Applications

All applications that are linked dynamically to Qt6 will support Latin1 in file and directory names with this patch.

Nevertheless, some fine tuning may be necessary if you also want to use Latin1 in text files and show these characters correctly in the Konsole. Here is a list of some of the applications that I use, how to set them up properly, and what works or doesn't work with umlauts in file names:

Qt Applications

Non Qt Applications

to be continued...

TODO

The workaround in qprocess.cpp could perhaps be avoided if KIO was also patched to behave properly in a Latin1 environment.

Links

openSUSE
GIT for qt6-base

My other projects

VDR - The Video Disk Recorder
Full Motion Flight Simulator
GeoTagger - Display and modify GPS location data in photos
Interface zur Verbindung einer digitalSTROM-Klemme GR-KL200 mit einem VELUX KLF 050x
Monitoring the Bluetti AC300 Power Supply

Impressum
[counter]