-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from ZOSOpenTools/utf8_vim
Use UTF-8 as the default encoding for z/OS
- Loading branch information
Showing
3 changed files
with
29 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
diff --git a/src/option.c b/src/option.c | ||
index 1203180fb..9896c3711 100644 | ||
--- a/src/option.c | ||
+++ b/src/option.c | ||
@@ -434,9 +434,10 @@ set_init_default_encoding(void) | ||
char_u *p; | ||
int opt_idx; | ||
|
||
-# ifdef MSWIN | ||
+# if defined(MSWIN) || defined(__MVS__) | ||
// MS-Windows has builtin support for conversion to and from Unicode, using | ||
// "utf-8" for 'encoding' should work best for most users. | ||
+ // z/OS built should default to UTF-8 mode as setlocale does not respect utf-8 environment variable locales | ||
p = vim_strsave((char_u *)ENC_DFLT); | ||
# else | ||
// enc_locale() will try to find the encoding of the current locale. | ||
diff --git a/src/option.h b/src/option.h | ||
index 487d87c31..4769abf2b 100644 | ||
--- a/src/option.h | ||
+++ b/src/option.h | ||
@@ -124,7 +124,7 @@ typedef enum { | ||
#define ENC_UCSBOM "ucs-bom" // check for BOM at start of file | ||
|
||
// default value for 'encoding' | ||
-#ifdef MSWIN | ||
+#if defined(MSWIN) || defined(__MVS__) | ||
# define ENC_DFLT "utf-8" | ||
#else | ||
# define ENC_DFLT "latin1" |