From kde-commits Tue Sep 23 23:41:27 2008 From: Ambroz Bizjak Date: Tue, 23 Sep 2008 23:41:27 +0000 To: kde-commits Subject: branches/KDE/4.1/kdelibs/solid/solid/backends/hal Message-Id: <1222213287.145558.7518.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=122221332117465 SVN commit 864120 by abizjak: Pass the user's locale to HAL when using the ntfs-3g driver. If ntfs-3g is not provided a locale, it will fail to show any files with non-ascii characters in the name, and fail to create such files. M +12 -0 halstorageaccess.cpp --- branches/KDE/4.1/kdelibs/solid/solid/backends/hal/halstorageaccess.cpp #864119:864120 @@ -28,6 +28,7 @@ #include #include +#include #include "halfstabhandling.h" @@ -308,6 +309,17 @@ } } } + + // pass our locale to the ntfs-3g driver so it can translate local characters + if ( m_device->property("volume.fstype").toString()=="ntfs-3g" && halOptions.contains("locale=") ) { + // have to obtain LC_CTYPE as returned by the `locale` command + // check in the same order as `locale` does + char *cType; + if ( (cType = getenv("LC_ALL")) || (cType = getenv("LC_CTYPE")) || (cType = getenv("LANG")) ) { + options << "locale="+QString(cType); + } + } + msg << "" << "" << options; return c.callWithCallback(msg, this,