info-mtools
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Info-mtools] mtools does not work in Turkish locale


From: Chris Lamb
Subject: [Info-mtools] mtools does not work in Turkish locale
Date: Thu, 22 Oct 2020 16:55:04 -0000
User-agent: Cyrus-JMAP/3.3.0-529-g69105b1-fm-20201021.003-g69105b13

Hi info-mtools,

Just wanted to pass on a report that mtools does not work in Turkish
locale. This was originally reported here:

  https://bugs.debian.org/972387

In particular:

  $ LC_CTYPE=tr_TR.UTF-8 mtools
  Syntax error at line 5 for drive A: column 9 in file /etc/mtools.conf: 
unrecognized keyword

  $ echo $?
  1

  $ LC_CTYPE=C mtools
  Supported commands:
  mattrib, mbadblocks, mcat, mcd, mclasserase, mcopy, mdel, mdeltree
  mdir, mdoctorfat, mdu, mformat, minfo, mlabel, mmd, mmount
  mpartition, mrd, mread, mmove, mren, mshowfat, mshortname, mtoolstest
  mtype, mwrite, mzip


As I describe in my followup to that bug, I can confirm that this is
indeed locale issue, as commenting out the setlocale(3) call at the
top of the "main" entry point fixes this issue.

The following "patch" against mtools.c also ""works"" for me:

  +#ifdef HAVE_SETLOCALE
  +       char *old_locale = setlocale(LC_ALL, NULL);
  +       setlocale(LC_ALL, "C");
  +       read_config();
  +       setlocale(LC_ALL, old_locale);
  +#else
          read_config();
  +#endif


.. but this is obviously not right, as it would mean that genuine
syntax errors printed in read_config() would not be translated into,
well, Turkish. Can't seem to get a "C" locale version of toupper(3) to
work right this second, and am assuming you folks will have a cleaner
solution anyway, hence forwarding this to you.


Regards,

--
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby@debian.org 🍥 chris-lamb.co.uk
       `-



reply via email to

[Prev in Thread] Current Thread [Next in Thread]