After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 669525 - gedit cannot guess GB family encodings correctly
gedit cannot guess GB family encodings correctly
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
unspecified
Other Linux
: Normal major
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2012-02-07 04:16 UTC by Ma Hsiao-chun
Modified: 2013-11-09 20:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the test case (482.97 KB, text/plain)
2012-02-07 04:16 UTC, Ma Hsiao-chun
  Details
the patch for document-output-stream.c (1.87 KB, patch)
2012-02-07 04:17 UTC, Ma Hsiao-chun
none Details | Review

Description Ma Hsiao-chun 2012-02-07 04:16:45 UTC
Created attachment 206948 [details]
the test case

The test file, gbk.txt, is from an attachment of the following (old) bug report.
https://bugzilla.redhat.com/show_bug.cgi?id=576047

My environment

$ gedit --version
gedit - Version 3.2.6

$ gsettings get org.gnome.gedit.preferences.encodings auto-detected
['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']

$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

$ cat /etc/redhat-release
Fedora release 16 (Verne)

My test procedure

LANG=zh_CN.gbk gedit gbk.txt #FAIL
LANG=zh_CN.gb18030 gedit gbk.txt #FAIL
gedit --encoding gbk gbk.txt #PASS, but no guess here

I also write code to do essentially same testing inside document-output-stream.c. It is a patch to git version I just cloned. It is the first time I submit a patch, please forgive me in case there are mistakes.
Comment 1 Ma Hsiao-chun 2012-02-07 04:17:51 UTC
Created attachment 206949 [details] [review]
the patch for document-output-stream.c
Comment 2 Sébastien Wilmet 2013-11-09 20:31:12 UTC
Should be fixed with a more recent gedit version.