Skip to content

Commit

Permalink
Merge pull request #16 from ZOSOpenTools/utf8_vim
Browse files Browse the repository at this point in the history
Use UTF-8 as the default encoding for z/OS
  • Loading branch information
IgorTodorovskiIBM authored Apr 18, 2023
2 parents 24d8bef + a45127f commit 6572c90
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 27 deletions.
1 change: 0 additions & 1 deletion buildenv
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export ZOPEN_TYPE="GIT"

export ZOPEN_GIT_URL="https://github.com/vim/vim.git"
export ZOPEN_GIT_DEPS="git make zoslib ncurses diffutils coreutils findutils sed gawk"
export ZOPEN_GIT_TAG="v9.0.0846"
export ZOPEN_EXTRA_CONFIGURE_OPTS="--with-features=big --with-x=no --enable-gui=no --enable-cscope"
export ZOPEN_CHECK="./src/vim"
export ZOPEN_CHECK_OPTS="--version"
Expand Down
26 changes: 0 additions & 26 deletions patches/PR1/term_escape.patch

This file was deleted.

29 changes: 29 additions & 0 deletions patches/option.patch
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"

0 comments on commit 6572c90

Please sign in to comment.