proper UTF-8 defaults

This commit is contained in:
Dave Murphy 2017-03-06 10:32:33 +00:00
parent 0cc4623212
commit 6fa30085c6

View File

@ -611,7 +611,7 @@ index 0000000..b6cdfae
+m4_include([../acinclude.m4])
diff --git a/libgloss/libsysbase/build_argv.c b/libgloss/libsysbase/build_argv.c
new file mode 100644
index 0000000..79d2006
index 0000000..3ca95d5
--- /dev/null
+++ b/libgloss/libsysbase/build_argv.c
@@ -0,0 +1,31 @@
@ -648,7 +648,7 @@ index 0000000..79d2006
+}
diff --git a/libgloss/libsysbase/chdir.c b/libgloss/libsysbase/chdir.c
new file mode 100644
index 0000000..2a0fa03
index 0000000..90d2dc5
--- /dev/null
+++ b/libgloss/libsysbase/chdir.c
@@ -0,0 +1,201 @@
@ -855,7 +855,7 @@ index 0000000..2a0fa03
+}
diff --git a/libgloss/libsysbase/chmod.c b/libgloss/libsysbase/chmod.c
new file mode 100644
index 0000000..ce79a2c
index 0000000..3668b58
--- /dev/null
+++ b/libgloss/libsysbase/chmod.c
@@ -0,0 +1,30 @@
@ -891,7 +891,7 @@ index 0000000..ce79a2c
+
diff --git a/libgloss/libsysbase/close.c b/libgloss/libsysbase/close.c
new file mode 100644
index 0000000..d3563fb
index 0000000..a251e5b
--- /dev/null
+++ b/libgloss/libsysbase/close.c
@@ -0,0 +1,49 @@
@ -5141,7 +5141,7 @@ index 0000000..c4b5a79
+
diff --git a/libgloss/libsysbase/configure.in b/libgloss/libsysbase/configure.in
new file mode 100644
index 0000000..4c31956
index 0000000..bf276a4
--- /dev/null
+++ b/libgloss/libsysbase/configure.in
@@ -0,0 +1,199 @@
@ -5721,7 +5721,7 @@ index 0000000..c6b8c92
+}
diff --git a/libgloss/libsysbase/fork.c b/libgloss/libsysbase/fork.c
new file mode 100644
index 0000000..712b13e
index 0000000..3aa75a3
--- /dev/null
+++ b/libgloss/libsysbase/fork.c
@@ -0,0 +1,25 @@
@ -6469,7 +6469,7 @@ index 0000000..4565909
+char *fake_heap_start = (char*)0;
diff --git a/libgloss/libsysbase/mkdir.c b/libgloss/libsysbase/mkdir.c
new file mode 100644
index 0000000..4175cf8
index 0000000..b4fcbd3
--- /dev/null
+++ b/libgloss/libsysbase/mkdir.c
@@ -0,0 +1,19 @@
@ -6612,7 +6612,7 @@ index 0000000..7f3f7f2
+
diff --git a/libgloss/libsysbase/rename.c b/libgloss/libsysbase/rename.c
new file mode 100644
index 0000000..7520d1d
index 0000000..f8a0aa9
--- /dev/null
+++ b/libgloss/libsysbase/rename.c
@@ -0,0 +1,41 @@
@ -6806,7 +6806,7 @@ index 0000000..e474c47
+
diff --git a/libgloss/libsysbase/statvfs.c b/libgloss/libsysbase/statvfs.c
new file mode 100644
index 0000000..b3dec22
index 0000000..84e2213
--- /dev/null
+++ b/libgloss/libsysbase/statvfs.c
@@ -0,0 +1,24 @@
@ -6941,7 +6941,7 @@ index 0000000..044f12d
+
diff --git a/libgloss/libsysbase/times.c b/libgloss/libsysbase/times.c
new file mode 100644
index 0000000..67db6c7
index 0000000..45e9781
--- /dev/null
+++ b/libgloss/libsysbase/times.c
@@ -0,0 +1,21 @@
@ -7075,7 +7075,7 @@ index 0000000..9a61639
+
diff --git a/libgloss/libsysbase/wait.c b/libgloss/libsysbase/wait.c
new file mode 100644
index 0000000..322c847
index 0000000..f64bf13
--- /dev/null
+++ b/libgloss/libsysbase/wait.c
@@ -0,0 +1,29 @@
@ -7515,7 +7515,7 @@ index 84219ca..af9d12c 100644
#if defined(__CYGWIN__) || defined(__rtems__)
int _EXFUN(getdtablesize, (void));
diff --git a/newlib/libc/locale/locale.c b/newlib/libc/locale/locale.c
index 8572821..52b6469 100644
index 8572821..e6baf35 100644
--- a/newlib/libc/locale/locale.c
+++ b/newlib/libc/locale/locale.c
@@ -107,7 +107,7 @@ beginning with <<"LC_">>.
@ -7552,14 +7552,44 @@ index 8572821..52b6469 100644
#ifndef DEFAULT_LOCALE
-#define DEFAULT_LOCALE "C"
+#ifdef __DEFAULT_UTF8__
+#define DEFAULT_LOCALE "C"
+#else
+#define DEFAULT_LOCALE "C.UTF-8"
+#else
+#define DEFAULT_LOCALE "C"
+#endif
#endif
#ifdef _MB_CAPABLE
@@ -255,10 +262,11 @@ const struct __locale_t __C_locale =
@@ -222,8 +229,13 @@ char __default_locale[ENCODING_LEN + 1] = DEFAULT_LOCALE;
const struct __locale_t __C_locale =
{
{ "C", "C", "C", "C", "C", "C", "C", },
+#if defined ( __DEFAULT_UTF8__ )
+ __utf8_wctomb,
+ __utf8_mbtowc,
+#else
__ascii_wctomb,
__ascii_mbtowc,
+#endif
0,
DEFAULT_CTYPE_PTR,
{
@@ -234,9 +246,15 @@ const struct __locale_t __C_locale =
CHAR_MAX, CHAR_MAX
},
#ifndef __HAVE_LOCALE_INFO__
+#ifdef __DEFAULT_UTF8__
+ "\6",
+ "UTF-8",
+ "UTF-8",
+#else
"\1",
"ASCII",
"ASCII",
+#endif
#else /* __HAVE_LOCALE_INFO__ */
{
{ NULL, NULL }, /* LC_ALL */
@@ -255,10 +273,11 @@ const struct __locale_t __C_locale =
};
#endif /* _MB_CAPABLE */
@ -7572,7 +7602,23 @@ index 8572821..52b6469 100644
__utf8_wctomb,
__utf8_mbtowc,
#else
@@ -312,7 +320,7 @@ _DEFUN(_setlocale_r, (p, category, locale),
@@ -275,9 +294,15 @@ struct __locale_t __global_locale =
CHAR_MAX, CHAR_MAX
},
#ifndef __HAVE_LOCALE_INFO__
+#ifdef __DEFAULT_UTF8__
+ "\6",
+ "UTF-8",
+ "UTF-8",
+#else
"\1",
"ASCII",
"ASCII",
+#endif
#else /* __HAVE_LOCALE_INFO__ */
{
{ NULL, NULL }, /* LC_ALL */
@@ -312,7 +337,7 @@ _DEFUN(_setlocale_r, (p, category, locale),
{
#ifndef _MB_CAPABLE
if (locale)
@ -7581,7 +7627,7 @@ index 8572821..52b6469 100644
if (strcmp (locale, "POSIX") && strcmp (locale, "C")
&& strcmp (locale, ""))
return NULL;
@@ -995,6 +1003,7 @@ __locale_ctype_ptr_l (struct __locale_t *locale)
@@ -995,6 +1020,7 @@ __locale_ctype_ptr_l (struct __locale_t *locale)
const char *
__locale_ctype_ptr (void)