bsduck I don't have problems on FreeBSD with the same programs. Both file dialogs show the file and can open it.
Bizarre. Featherpad behaves identically for me on both FreeBSD and NetBSD.
pin Can you please test this settings and at the same time disable uim
on LXQt?
No change (and, didn't expect any) with:
$ env LANG=C LC_TIME=C LC_NUMERIC=C LC_MONETARY=C LC_MESSAGES=C featherpad
Native (ticked) chooser shows the file, but, tries to open caff?.txt
instead of caffè.txt
Unticked chooser doesn't show the file at all.
Can you guys try this patch?
diff -urN FeatherPad-1.3.1.orig/featherpad/main.cpp FeatherPad-1.3.1/featherpad/main.cpp
--- FeatherPad-1.3.1.orig/featherpad/main.cpp 2022-07-31 14:37:30.000000000 +0000
+++ FeatherPad-1.3.1/featherpad/main.cpp 2022-08-17 23:02:38.864572116 +0000
@@ -43,9 +43,17 @@
int main (int argc, char **argv)
{
+ std::locale::global(std::locale(""));
+ QLocale::setDefault(QLocale::system());
+
const QString name = "FeatherPad";
const QString version = "1.3.1";
const QString firstArg = QString::fromUtf8 (argv[1]);
+{
+ QTextStream out (stdout);
+ out << "File: " << firstArg << Qt::endl;
+}
+
if (firstArg == "--help" || firstArg == "-h")
{
QTextStream out (stdout);
It should be using the user-configured locale (LANG=
and LC_ALL=
, etc) now, but, doesn't seem to for some C++ reason I can't fathom.
Run Featherpad as featherpad caffè.txt
(or any other UTF-8 encoded filename) and see if the program prints caff?.txt
or caffè.txt
when LANG
or LC_ALL
is set to a UTF-8 locale (any will do: en_US.UTF-8
, en_GB.UTF-8
, even C.UTF-8
).
If they are set to the C
locale, then it should (obviously) always print caff?.txt
.
However, even with the patch Featherpad always shows caff?.txt
, when this code prints caffè.txt
in a UTF-8 locale:
//
// c++ -fpic q.cpp $(pkg-config --cflags Qt5Core) $(pkg-config --libs Qt5Core)
//
#include <locale>
#include <QTextStream>
int main(int argc, char* argv[]) {
if (argc != 2)
return 1;
// replace the C++ global locale as well as the C locale
// with the user-preferred locale
std::locale::global(std::locale(""));
const QString filename = QString::fromUtf8(argv[1]);
QTextStream out (stdout);
out << filename << Qt::endl;
return 0;
}
C++ devs please have a look...
PS. I made a cmake
project out of this just to test it out. PM me if you want the tarball.