diff options
| author | Alan Third | 2016-04-08 15:52:55 +0200 |
|---|---|---|
| committer | Anders Lindgren | 2016-04-08 15:52:55 +0200 |
| commit | f6497c6e760b3b50015f35d7ce5a36df628ee498 (patch) | |
| tree | 4b135795b61a4447133085eabba8f57c2a13616d /src | |
| parent | 7ad1d075b940f276adaf3b6bb0c024079c403f80 (diff) | |
| download | emacs-f6497c6e760b3b50015f35d7ce5a36df628ee498.tar.gz emacs-f6497c6e760b3b50015f35d7ce5a36df628ee498.zip | |
Set locale encoding to UTF-8 when run from OS X GUI.
* src/nsterm.m (ns_init_locale): Append .UTF-8 when setting LANG.
Diffstat (limited to 'src')
| -rw-r--r-- | src/nsterm.m | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nsterm.m b/src/nsterm.m index 4048ac46546..34c5395b630 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -596,8 +596,15 @@ ns_init_locale (void) | |||
| 596 | 596 | ||
| 597 | @try | 597 | @try |
| 598 | { | 598 | { |
| 599 | /* It seems OS X should probably use UTF-8 everywhere. | ||
| 600 | 'localeIdentifier' does not specify the encoding, and I can't | ||
| 601 | find any way to get the OS to tell us which encoding to use, | ||
| 602 | so hard-code '.UTF-8'. */ | ||
| 603 | NSString *localeID = [NSString stringWithFormat:@"%@.UTF-8", | ||
| 604 | [locale localeIdentifier]]; | ||
| 605 | |||
| 599 | /* Set LANG to locale, but not if LANG is already set. */ | 606 | /* Set LANG to locale, but not if LANG is already set. */ |
| 600 | setenv("LANG", [[locale localeIdentifier] UTF8String], 0); | 607 | setenv("LANG", [localeID UTF8String], 0); |
| 601 | } | 608 | } |
| 602 | @catch (NSException *e) | 609 | @catch (NSException *e) |
| 603 | { | 610 | { |