Bug 217864

Summary: KConfigGroup does not accept UTF-8 characters in the group name only upon loading
Product: [Unmaintained] kdelibs Reporter: Dario Freddi <drf>
Component: kdecoreAssignee: kdelibs bugs <kdelibs-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: cfeck, christoph, ctibor.brancik, faure
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Dario Freddi 2009-12-08 14:45:51 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

KConfigGroup allows saving groups with UTF-8 characters in the name, however returns an invalid config group upon loading them. This bug was discovered in PowerDevil throughout bug 211082 (which I'll mark as a duplicate of this one), and it's very easy to reproduce. Just create a config group named aèèòa, save it, and try loading it through KConfigGroup constructor afterwards.
Comment 1 Dario Freddi 2009-12-08 14:48:07 UTC
*** Bug 211082 has been marked as a duplicate of this bug. ***
Comment 2 Christoph Feck 2009-12-08 19:59:57 UTC
David, does this fix the issue?

Index: kconfigini.cpp
===================================================================
--- kconfigini.cpp      (revision 1060385)
+++ kconfigini.cpp      (working copy)
@@ -474,6 +474,7 @@
             fclose(fp);
             return false;
         }
+        f.setTextModeEnabled(true);
         writeEntries(locale, f, writeMap);
         f.close();
         fclose(fp);
Comment 3 Oswald Buddenhagen 2010-02-28 22:15:43 UTC
SVN commit 1097299 by ossi:

test reading & writing of groups with accented chars - works

CCBUG: 217864

 M  +20 -0     kconfigtest.cpp  
 M  +1 -0      kconfigtest.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1097299
Comment 4 David Faure 2010-12-23 00:24:29 UTC
Dario: do you still have this issue?
Do you have your test code somewhere? I suspect it might be buggy :)
Comment 5 Dario Freddi 2010-12-28 18:38:23 UTC
Hey, I will try to reproduce later, but the issue hasn't occurred since a while... I'll check and let you know :)
Comment 6 Christoph Cullmann 2024-06-20 19:06:47 UTC
Should be fixed.