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 131668 - default encoding saving for new file
default encoding saving for new file
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
2.14.x
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
gedit QA volunteers
Depends on:
Blocks:
 
 
Reported: 2004-01-16 10:46 UTC by Frederic Crozat
Modified: 2013-02-24 16:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Always use current encoding for new files (created from command line) (1.42 KB, patch)
2004-02-16 16:17 UTC, Frederic Crozat
none Details | Review

Description Frederic Crozat 2004-01-16 10:46:32 UTC
Follow-up of Mdk bug http://qa.mandrakesoft.com/show_bug.cgi?id=6887 :

default value of /apps/gedit-2/preferences/editor/save/save_encoding is
GEDIT_SAVE_ALWAYS_UTF8.

On system with non-UTF8 locale, this is causing new file created in gedit
to be UTF-8. I'm not sure it is very wise (and if UTF-8 is THE way to go..)
Comment 1 Paolo Maggi 2004-01-16 11:15:37 UTC
Actually /apps/gedit-2/preferences/editor/save/save_encoding is no
more used in 2.4 (I missed to remove it)

I will remove it in 2.5

A simple solution for 2.4 is changing the default of
encodings/auto_detected key to [CURRENT,UTF-8,ISO-8859-15].
In this way gedit should consider empty new files encoded in the
CURRENT  locale.
I'm not sure about adopting this solution in 2.5 too. Probably a
solution based on gedit-metadata will be better. But I have still to
think about it.

Do we want to use CURRENT locale as default in 2.5?

Note that CURRENT == UTF-8 if utf-8 is the current locale so for
distros that use utf-8 as default locale having [CURRENT, UTF-8] or
[UTF-8, CURRENT] is the equivalent.
Comment 2 Frederic Crozat 2004-02-16 16:17:50 UTC
Created attachment 24451 [details] [review]
Always use current encoding for new files (created from command line)
Comment 3 Paolo Borelli 2004-03-06 13:49:30 UTC
adding the patch keyword. Paolo, should this go in for 2.6?
Comment 4 Paolo Maggi 2004-12-05 15:14:57 UTC
I'm not going to apply this patch upstream for the following reasons:

1. I think UTF-8 is _the_ way to go

2. gedit is an UTF-8 text editor

3. it does not work well in the following case: 

   User's locale encoding is "ANSI_X3.4-1968" aka "US-ASCII"
   User creates a new a.txt file (that is created using ANSI_X3.4-1968 as 
   encoding).
   User writes "Oggi è una bella giornata"
   User saves the files.
   An error dialog is displayed: "Could not save the file     
   '/opt/gnome/gnome210/a.txt'. Invalid byte sequence in conversion input."

Closing as WONTFIX.
Comment 5 Loïc Minier 2005-07-27 07:39:44 UTC
Reopening as discussed with pbor on IRC.  I will argument ASAP.
Comment 6 Loïc Minier 2005-08-12 15:19:24 UTC
(Oopsy-daisy, I kind of forgot about this bug...)

I discussed this issue on IRC with pbor since a Debian wishlist report was
opened: it seems quite a lot of people are disturbed by the fact that UTF-8 is
imposed for NEW documents that you save for the first time. (Debian's bug is
http://bugs.debian.org/320037.)

It's pretty clear that you can't save all texts in all formats, and since Gedit
uses UTF-8 internally, saving in UTF-8 will always succeed.  However, if ones
considesr what gedit offers for opening files, it's clear that UTF-8 is not 100%
correct.
  That's why there's a GConf config option for the order of charsets to try when
converting a file that's being opened, and one of them is special, it's the
locale charset.

Now imagine the same thing, but for saving: it's pretty clear that if the user
wants gedit to try opening in its locale first before trying eg UTF-8, he might
want the same strategy for saving.  For example, if he types some text that can
be stored under his locale and under UTF-8, he might want his locale to be the
default encoding.

So, would it be possible to attempt the conversion when saving the first
characters of a new document (I suppose in the same way as it's attempted with
the first bytes of a loaded file) with a list of gconf-configured charsets?

This could be [locale, UTF-8] by default, or [UTF-8], and that would permit the
user to save new files in his locale or in UTF-8 *if* possible.

Let me know if I'm not clear enough, I know it sounds a bit strange.

Bye,
Comment 7 Andre Wendt 2006-05-14 10:02:30 UTC
I am the reporter of Debian bug #320037 (see above) and I just received version 2.14 of gedit.

I'm sorry to say, but obviously you don't get the problem with gedit's behavior. I don't care about gedit's internal encoding, I don't care about UTF-8 either.

All I want to do (and GNOME's "easy to use" principle agrees on that) is write something in a new file, hit save, enter the filename and hit OK. I don't want to (and shouldn't have to) fiddle with encodings whatsoever, but still be able to open that file with any other editor, preferably vi. If my locale is set to ISO-8859-1(5), the file is to be saved in ISO-8859-1(5). Period.

And if you don't want that behavior to be the default, make it configurable! I can't believe I still can't tell gedit in the preferences to leave me alone with UTF-8! I still have to tell gedit to use my locale every single time I save a file!

If you give me a howto to reliably tell gedit to save all new files in my locale instead of UTF-8, I will shut up. But haven't been able to do that.

My current (non-working) gconf setting is:

/apps/gedit-2/preferences/encodings/auto_detected = [locale,ISO-8859-15]

I can't seem to find any other setting dealing with encodings.

Regards,
André
Comment 8 rulatir 2009-05-28 14:07:25 UTC
Seconded after two years!

STOP FORCING UTF-8 ON PEOPLE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
Comment 9 Urmas 2010-05-18 01:28:43 UTC
If your software doesn't process or display UTF-8 text correctly in 2010, after 12 years past corresponding RFC release, it is your own problem.

Please close this as WONTFIX, most systems use UTF-8 locale now; those who don't please don't enforce this retardation on all users.
Comment 10 André Klapper 2012-07-29 18:09:05 UTC
/apps/gedit-2/preferences/editor/save/save_encoding does not exist anymore.
Is this still an issue in 3.4? Or is this WONTFIX?
Comment 11 Sébastien Wilmet 2013-02-24 16:51:17 UTC
When saving a document, we can now choose the encoding, and by default it is chosen from the current locale.