unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: Random832 <random832@fastmail.com>
Cc: 22392@debbugs.gnu.org
Subject: bug#22392: 25.0.50; NS Emacs run from OS X GUI doesn't set locale
Date: Mon, 18 Jan 2016 23:11:43 +0000	[thread overview]
Message-ID: <m260yqtrdc.fsf@galloway.idiocy.org> (raw)
In-Reply-To: <1453154942.1231266.495690338.5BC96C7B@webmail.messagingengine.com> (Random's message of "Mon, 18 Jan 2016 17:09:02 -0500")

Random832 <random832@fastmail.com> writes:

> On Mon, Jan 18, 2016, at 16:12, Alan Third wrote:
>> I don't know if it's appropriate for OS X, but I'm pretty sure it
>> matches the codings that the Windows port gives me for en_GB (ENG, in
>> Windows). Besides, surely it's better than 'nil'?
>
> Well, I don't have any trouble opening UTF-8 files. I'm incidentally not
> sure that it's really appropriate for windows, either - there, it should
> be using windows-1252, not iso-latin-1. I have to wonder how Emacs
> behaves on versions of windows whose default codepage is not a trivial
> superset of an ISO one. The proper encoding should be able to be
> determined by the GetACP function, and should always be a windows
> codepage.

I realised almost immediately after sending the message that this is
crap. What I was thinking was that in Windows I don't get a UTF-8
coding. You're entirely right.

>> The other possibility is that Terminal.app sets LANG to 'en_GB.UTF-8'.
>> That final part may be the difference we're seeing here?
>
> Yes, I think so. I was wondering also if there's some hidden setting
> that tells Terminal whether to use UTF-8 or not - I don't think it used
> it in the earliest versions of OSX.

There's a setting in Profiles -> Advanced that lets you select UTF-8.
It's UTF-8 by default on my system. If I change it I get just "en_GB".

Just to test I changed my code to append ".UTF-8" on the end of what
it's pulling from the system (so on my machine LANG gets set to
"en_GB.UTF-8", and here's the output from c-H C RET:

Coding system for saving this buffer:
  Not set locally, use the default.
Default coding system (for new files):
  U -- utf-8-unix (alias: mule-utf-8-unix)

Coding system for keyboard input:
  U -- utf-8-unix (alias: mule-utf-8-unix)

Coding system for terminal output:
  U -- utf-8-unix (alias: mule-utf-8-unix)

Coding system for inter-client cut and paste:
  nil
Defaults for subprocess I/O:
  decoding: U -- utf-8-unix (alias: mule-utf-8-unix)

  encoding: U -- utf-8-unix (alias: mule-utf-8-unix)


Priority order for recognizing coding systems when reading files:
  1. utf-8 (alias: mule-utf-8)
  2. iso-2022-7bit 
  3. iso-latin-1 (alias: iso-8859-1 latin-1)
  4. iso-2022-7bit-lock (alias: iso-2022-int-1)
  5. iso-2022-8bit-ss2 

So that does make a difference.

The question is what is the correct behaviour here? I, like you, would
rather get UTF-8 everywhere, but is that the *correct* behaviour for an
unconfigured system run from the GUI?

>> > This one also makes me wonder if the encoding specified in
>> > .CFUserTextEncoding/__CF_USER_TEXT_ENCODING should be used for a second
>> > choice. Which may be an encoding that may not map directly to a locale.

Possibly. I believe there's a way to extract a list of preferred
languages from OS X which are separate from the selected locale. That
may be a better way? Although, thinking about it, languages don't
necessarily map to encodings either.

> You may have a file .CFUserTextEncoding in your home directory, or an
> environment variable __CF_USER_TEXT_ENCODING, specifying a value like
> [0x1F5:]0x0:0x0 - the first one (in the environment variable only) is
> your user ID, the next is the encoding (0x0 for MacRoman) which Finder
> uses for preview of non-UTF8 text files, and the last is the language (0
> for English, maybe only US English)

Ah yes, I have exactly the same as you.
-- 
Alan Third





  reply	other threads:[~2016-01-18 23:11 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m27fix2thu.fsf@galloway.idiocy.org>
2016-01-26  7:11 ` bug#22392: Emacs OS X GUI doesn't set locale Anders Lindgren
     [not found] ` <CABr8ebazqBT5tVtRc_bDj0x72gR52T=zAmmamyhkTB8e4pz6rg@mail.gmail.com>
2016-01-26 14:44   ` Eli Zaretskii
     [not found]   ` <83twm01ju1.fsf@gnu.org>
2016-01-26 15:06     ` Anders Lindgren
     [not found]     ` <CABr8ebbTc1no_vra4m2Q6sbC=VqaZ4Xn8OGnQu78Z=uquKpGRA@mail.gmail.com>
2016-01-26 15:14       ` Eli Zaretskii
     [not found]       ` <83lh7c1igo.fsf@gnu.org>
2016-01-26 16:58         ` Anders Lindgren
2016-01-26 23:05         ` Alan Third
     [not found]         ` <m2bn880wna.fsf@galloway.idiocy.org>
2016-01-27 18:06           ` Paul Eggert
2016-01-17 14:27             ` bug#22392: 25.0.50; NS Emacs run from " Alan Third
2016-01-17 22:38               ` Random832
2016-01-18 21:12                 ` Alan Third
2016-01-18 22:09                   ` Random832
2016-01-18 23:11                     ` Alan Third [this message]
2016-01-19 15:55                       ` Eli Zaretskii
2016-01-19 16:03                     ` Eli Zaretskii
2016-01-30  6:13               ` bug#22392: Emacs " Random832
2016-02-05  7:12               ` Random832
2016-02-05  7:32                 ` Eli Zaretskii
2016-02-05  7:36                   ` Random832
2016-02-05  9:21                     ` Eli Zaretskii
2016-02-05 17:28                       ` Random832
2016-02-05 19:46                         ` Eli Zaretskii
     [not found]           ` <56A90735.7090508@cs.ucla.edu>
2016-01-27 19:44             ` Eli Zaretskii
     [not found]             ` <83fuxizu1d.fsf@gnu.org>
2016-01-27 22:27               ` Paul Eggert
2016-01-28 22:53             ` Alan Third
     [not found]             ` <m260ydxqmp.fsf@galloway.idiocy.org>
2016-02-01  5:03               ` Anders Lindgren
     [not found]               ` <CABr8ebZ21MwYwDTeHogk4Afg7m73LGiiiVWNz2y=tJ0SSSsysQ@mail.gmail.com>
2016-02-01 17:48                 ` Alan Third
2016-02-01 18:57                 ` Eli Zaretskii
2016-02-10 23:57                 ` Alan Third
2016-02-11  2:37                   ` Paul Eggert
2016-01-26 22:50   ` Alan Third
     [not found]   ` <m2fuxk0xbz.fsf@galloway.idiocy.org>
2016-01-27  6:21     ` Anders Lindgren
     [not found]     ` <CABr8ebb55SEwE2MOnKdSYm=xO6VReRU8g_dr0vN4CGMVwVYrvg@mail.gmail.com>
2016-01-27 15:53       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m260yqtrdc.fsf@galloway.idiocy.org \
    --to=alan@idiocy.org \
    --cc=22392@debbugs.gnu.org \
    --cc=random832@fastmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).