Permalink
Browse files

preserve all utf-8 chars if CONFIG_UNICODE_PRESERVE_BROKEN

  • Loading branch information...
1 parent 12aaa1f commit 27a33d514c0fc12b06b99f31871330e67c27e9d6 @tpruvot committed May 8, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 libbb/unicode.c
View
@@ -37,7 +37,7 @@ void FAST_FUNC reinit_unicode(const char *LANG)
unicode_status = (width == 1 ? UNICODE_ON : UNICODE_OFF);
}
-void FAST_FUNC init_unicode(void)
+void FAST_FUNC init_unicode()
{
if (unicode_status == UNICODE_UNKNOWN)
reinit_unicode(getenv("LANG"));
@@ -56,7 +56,7 @@ void FAST_FUNC reinit_unicode(const char *LANG)
unicode_status = UNICODE_ON;
}
-void FAST_FUNC init_unicode(void)
+void FAST_FUNC init_unicode()
{
if (unicode_status == UNICODE_UNKNOWN)
reinit_unicode(getenv("LANG"));
@@ -1006,9 +1006,11 @@ static char* FAST_FUNC unicode_conv_to_printable2(uni_stat_t *stats, const char
} else {
d = dst = xstrndup(src, width);
while (*d) {
+#if !ENABLE_UNICODE_PRESERVE_BROKEN
unsigned char c = *d;
if (c < ' ' || c >= 0x7f)
*d = '?';
+#endif
d++;
}
}

1 comment on commit 27a33d5

Please sign in to comment.