Version: 1.4 (using 4.4.00 (KDE 4.4.0), Gentoo) Compiler: x86_64-pc-linux-gnu-gcc OS: Linux (x86_64) release 2.6.32-gentoo On system with UTF-8 locale Dolphin file previews (Info panel, mouse-over) display text files with wrong encoding. Steps to reproduce: Create text file with UTF-8 content where the one of first non-latin symbols is letter "ē" (i.e. echo "Šķēle" > myfile) Text lenght isn't crittical. Plain letter "ē" also is just fine to reproduce issue. Look file content preview in Dolphin. * Searching for *qt* ... [IP-] [ ] app-emulation/emul-linux-x86-qtlibs-20100220:0 [IP-] [ ] media-video/qt-recordmydesktop-0.3.8:0 [I--] [??] virtual/poppler-qt4-0.12.3-r1:0 [IP-] [ ] x11-libs/qt-3.3.8b-r2:3 [IP-] [ ] x11-libs/qt-core-4.6.2-r1:4 [IP-] [ ] x11-libs/qt-dbus-4.6.2:4 [IP-] [ ] x11-libs/qt-gui-4.6.2:4 [IP-] [ ] x11-libs/qt-opengl-4.6.2:4 [IP-] [ ] x11-libs/qt-qt3support-4.6.2:4 [IP-] [ ] x11-libs/qt-script-4.6.2:4 [IP-] [ ] x11-libs/qt-sql-4.6.2:4 [IP-] [ ] x11-libs/qt-svg-4.6.2:4 [IP-] [ ] x11-libs/qt-test-4.6.2:4 [IP-] [ ] x11-libs/qt-webkit-4.6.2:4 [IP-] [ ] x11-libs/qt-xmlpatterns-4.6.2:4 [IP-] [ ] x11-libs/qtscriptgenerator-0.1.0:0
Created attachment 41029 [details] Dolphin displays text file with wrong encoding Where do those Chinese glyphs come from?!?
The Chinese glyphs come from wrong detection of the text encoding. I tried using KEncodingProber::confidence(), but I could not get it to be "unsure" even for small text files.
I have no idea how it works internally, but if it's not possible to make a good guess, maybe it should use following logic: guess fail back to: locale fail back to: UTF-8. Displaying ASCII (C) as UTF-8 will have no harm; It's more than likely that file encoding will match locale encoding (i.e. in my case it's lv_LV.utf8). Of course, if it's possible to make encoding guessing more robust - it's way to go.
SVN commit 1103862 by cfeck: Use default locale encoding unless it is UTF It has to be seen if it is better to assume the locale encoding than to guess a wrong encoding. CCBUG: 228172 M +15 -3 textcreator.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1103862
*** Bug 236695 has been marked as a duplicate of this bug. ***
I didn't have this problem until I updated from kdemod 4.4.3 to regular kde 4.4.80 so I guess it's a configuration isuue, because 4.4.3 had cfeck's patch. I'm using ArchLinux x86_64 and my locale is es_AR.utf8
Andrés, the patch from comment #4 went to trunk (4.5), not 4.4 branch.
Then the patch is not working for me.
Seems to be working just fine with 4.6.0.