Bug 39108 - Kompare shows bad charset in compare view
Summary: Kompare shows bad charset in compare view
Status: RESOLVED FIXED
Alias: None
Product: kompare
Classification: Applications
Component: general (show other bugs)
Version: 3.3
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KDiff/Kompare bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-08 14:03 UTC by mrudolf
Modified: 2007-12-19 09:18 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Cyrillic text for diff (124 bytes, text/plain)
2004-12-12 01:55 UTC, Bozidar Proevski
Details
Avoid overwriting the selected charset (encoding) (892 bytes, patch)
2007-06-01 16:47 UTC, Jan Zimmerschied
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mrudolf 2002-03-08 13:35:37 UTC
(*** This bug was imported into bugs.kde.org ***)

Package: kompare
Version: 3.0rc1 (compiled from specs)
Source: tar.gz
Compiler: egcs version 1.1.2 20000217 (RedHat)
OS: Linux (i586) release 2.2.14

Bad charset is used in Kompare compared files view. Characters from current=
=20
charset (utf-8/iso-8859-2 for me - Polish language) are shown in=20
ascii/iso-8859-1. I see no way to configure it either.

--=20
Micha=B3 Rudolf
Comment 1 Otto Bruggeman 2002-03-09 15:02:34 UTC
On Fri 8 Mar 2002 Michal Rudolf wrote:
> Package: kompare
> Version: 3.0rc1 (compiled from specs)
> Source: tar.gz
> Compiler: egcs version 1.1.2 20000217 (RedHat)
> OS: Linux (i586) release 2.2.14
>
> Bad charset is used in Kompare compared files view. Characters from current
> charset (utf-8/iso-8859-2 for me - Polish language) are shown in
> ascii/iso-8859-1. I see no way to configure it either.

Can you tell m exactly when it happens ? I mean:
* does it happen when you compare 2 files in kompare ?
* does it happen when you read in a diff file you made yourself with diff?

If it is the first then i think i have found the problem if you compile
from source can you change the 2 lines in kompareprocess.cpp that have
fromLatin1 in them to fromLocal8Bit ? If this works please tell me as
soon as possible so i can fix this before the release.

If both can you give me some files in your encoding and a diff file then
so i can test for myself ? (Mail the files to me personally it does not
have to go through the list).

Thanks for the bug report
Otto
Comment 2 mrudolf 2002-03-10 14:32:50 UTC
W sob 9 mar 2002 16:02 Otto Bruggeman napisa=B3:

>Can you tell m exactly when it happens ? I mean:
>* does it happen when you compare 2 files in kompare ?
>* does it happen when you read in a diff file you made yourself with diff?
I found it while comparing 2 files.

>If it is the first then i think i have found the problem if you compile
>from source can you change the 2 lines in kompareprocess.cpp that have
>fromLatin1 in them to fromLocal8Bit ? If this works please tell me as
>soon as possible so i can fix this before the release.
I think you can safely change it as using fromLatin1 was not recommended.
I cannot compile KDE now (I just got new CVS version but it requires  newe=
r=20
version of some other packages I don't have yet.

But I think your fix should do the trick.

--=20
Micha=B3 Rudolf
Comment 3 Otto Bruggeman 2002-03-10 16:16:04 UTC
On Sun 10 Mar 2002 Michal Rudolf wrote:
> W sob 9 mar 2002 16:02 Otto Bruggeman napisa=B3:
>
> >Can you tell m exactly when it happens ? I mean:
> >* does it happen when you compare 2 files in kompare ?
> >* does it happen when you read in a diff file you made yourself with dif=
f?
> I found it while comparing 2 files.
>
> >If it is the first then i think i have found the problem if you compile
> >from source can you change the 2 lines in kompareprocess.cpp that have
> >fromLatin1 in them to fromLocal8Bit ? If this works please tell me as
> >soon as possible so i can fix this before the release.
> I think you can safely change it as using fromLatin1 was not recommended.
> I cannot compile KDE now (I just got new CVS version but it requires  ne=
wer
> version of some other packages I don't have yet.
>
> But I think your fix should do the trick.

Ok i will put it in CVS and leave the bug open for now until you can
confirm to me that it is fixed.

Otto
Comment 4 Bozidar Proevski 2004-12-12 01:55:12 UTC
Created attachment 8628 [details]
Cyrillic text for diff
Comment 5 Bozidar Proevski 2004-12-12 01:56:59 UTC
The bug shows again in KDE 3.3.1. No matter what is chosen for an encoding, Kompare shows the text in ascii/iso-8859-1. Running Slackware with KDE 3.3.1 downloaded from ftp://ftp.gwdg.de/pub/x11/kde. Same behavior seen on Mdk10.1
Comment 6 marazm 2005-01-12 12:54:34 UTC
Same bug in KDE 3.3.2 on Gentoo.

I needed to compare 2 files with UTF-8. I set encoding to UTF-8, but kompare showed to me those files w/o UTF-8 (latin1 or smtn else). And - whorse - after saving changes I got corrupted files - some UTF-8 chars where damaged and there was no way to automaticly correct this problem - search/replace give wrong results. 
Comment 7 erkin tek 2006-01-01 19:45:52 UTC
Same bug on turkish versions on both fc3, kde3.4 and pardus kde3.5.
my files are iso-8859-9 but when kompare compares it show as if were iso-8859-1, writes to disk as utf-8 chars. But these chars are false (in turkish (8859-9)we have I dot on it, but on (8859-1) it is Y dot on it).
i changed my console encoding tr to tr.utf succesfully but i cant make kompare work.
Comment 8 Simon Kim 2006-04-19 07:21:58 UTC
i think this problem is not effect dialog's encoding in compare
(see debug message . change from dialog->encoding to "default")
so  Kompare shows bad charset in compare view
i did solve this problem correct flowing part...


comment out : m_viewPart->setEncoding( "Default" );

in kompare_shell.cpp 

void KompareShell::compare(const KURL& source,const KURL& destination )
{
        m_sourceURL = source;
        m_destinationURL = destination;

        //m_viewPart->setEncoding( "Default" );
        m_viewPart->compare( source, destination );
}

void KompareShell::blend( const KURL& url1, const KURL& diff )
{
        m_sourceURL = url1;
        m_destinationURL = diff;

        //m_viewPart->setEncoding( "Default" );
        m_viewPart->openDirAndDiff( url1, diff );
}

Comment 9 Helge Hielscher 2006-08-06 16:31:42 UTC
*** This bug has been confirmed by popular vote. ***
Comment 10 Michał Kosmulski 2006-11-22 09:39:03 UTC
I'm using KDE 3.5.3 and the problem is still there. My system character encoding is UTF-8 (en_US.UTF-8 locale) but kompare shows all diffs as if they were 8-bit Latin1.
Comment 11 erkin tek 2006-11-22 16:46:15 UTC
Kdiff3 can be used instead
Comment 12 Jan Zimmerschied 2007-06-01 16:47:30 UTC
Created attachment 20752 [details]
Avoid overwriting the selected charset (encoding)

I think this patch can resolve following listed bugs 39108, 95054, 112729,
123683, 131280.
This patch avoids kompare to overwrite the charset (encoding) selected in the
file open dialog with the default charset defined by operating system.
Hopefully,
Jan
Comment 13 George Goldberg 2007-12-19 09:18:11 UTC
This is fixed in trunk for KDE4 and the KDE 3.5 branch.