Bug 169381

Summary: Text files preview does not support international symbols
Product: [Frameworks and Libraries] kdelibs Reporter: Ben Aceler <aceler>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: andresbajotierra, peterkur
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Screenshot

Description Ben Aceler 2008-08-18 18:01:35 UTC
Version:           1.1 (using 4.1.1 (KDE 4.1.0 (4.1 >= 20080722)) "release 26.3", KDE:KDE4:Factory:Desktop / openSUSE_11.0)
Compiler:          gcc
OS:                Linux (i686) release 2.6.25.11-0.1-pae

Some text files can contain non-ASCII characters, and dolphin will not show it with preview. Of course, it is a problem to determine codepage automatically, so onebyte codepages symbols in UTF-8 looks like ???? (this may be a cause of such behavior), but this works for UTF-8 files too.
Comment 1 Peter 2008-10-31 12:15:32 UTC
Created attachment 28248 [details]
Screenshot

non-ascii characters does not shown in the thumbnail
Comment 2 Peter 2008-10-31 12:17:56 UTC
Confirmed for Dolphin 1.1 in KDE 4.1.2
Comment 3 Dario Andres 2009-04-17 17:54:18 UTC
This is because the textthumbnail generator uses an ascii chart for the character fonts instead real fonts. However, text files containing non-ascii chars are not currently considered plain text files and therefore their preview aren't generated.
Comment 4 Christoph Feck 2009-07-02 15:25:28 UTC
SVN commit 990397 by cfeck:

Let Qt render text thumbnails

We used a tiny bitmapped font which was unfortunately lacking any
non ASCII characters. We now detect non ASCII files as text files,
so we should render them better.

This code uses the smallest readable font, but currently forces it
to a very small pixel size (similar to what the old code used).

The text encoding detection might need some improvements, e.g. use
the default locale encoding, when the prober is not very sure.

Reviewed by Peter Penz
Reviewed by Darío Andrés

See http://reviewboard.kde.org/r/760/

BUG: 169381
CCBUG: 188355


 M  +0 -1      CMakeLists.txt  
 M  +39 -112   textcreator.cpp  
 M  +0 -3      textcreator.h  
 D             thumbnailfont_7x4.png  


WebSVN link: http://websvn.kde.org/?view=rev&revision=990397