UTF-8 handling in the command line
Closed, ResolvedPublic


I think that the change of rG99c9bf7defd6: common: Assume an utf-8 locale on iconv errors. is not sufficient but requires more change to no_translation=1, as no_translation = 0 && use_iconv = 0 means iso-8859-1 conversion in utf8conv.c.

gniibe created this task.Aug 28 2020, 7:22 AM
gniibe updated the task description. (Show Details)Aug 28 2020, 7:25 AM

I mean:

diff --git a/common/utf8conv.c b/common/utf8conv.c
index 7804dbfcd..bdab225a9 100644
--- a/common/utf8conv.c
+++ b/common/utf8conv.c
@@ -138,7 +138,7 @@ handle_iconv_error (const char *to, const char *from, int use_fallback)
          native encoding.  Nowadays this seems to be the best bet in
          case of errors from iconv or nl_langinfo.  */
       active_charset_name = "utf-8";
-      no_translation = 0;
+      no_translation = 1;
       use_iconv = 0;
werner triaged this task as Normal priority.
werner closed this task as Resolved.Fri, Nov 27, 6:33 PM
werner added a subscriber: werner.

This has been fixed for Unix on 2.2 and 2.3. The command line fix for Windows is a larger thing already tracked by T4398.