unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Grep Japanese characters
Date: Thu, 12 Jul 2018 16:27:00 +0300	[thread overview]
Message-ID: <83601kfuu3.fsf@gnu.org> (raw)
In-Reply-To: <CAP_d_8XfmUU4vM2faXKvGLtyki+hWxVUs0ojv6O9nf2NgBjqfQ@mail.gmail.com> (message from Yuri Khan on Thu, 12 Jul 2018 12:05:51 +0700)

> From: Yuri Khan <yurivkhan@gmail.com>
> Date: Thu, 12 Jul 2018 12:05:51 +0700
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> 
> On Thu, Jul 12, 2018 at 9:41 AM Eli Zaretskii <eliz@gnu.org> wrote:
> 
> > You cannot pass UTF-8 encoded parameters to sub-programs on
> > MS-Windows.  You can only use the encoding of your system codepage.
> > Sorry, it's an MS-Windows limitation.
> 
> That’s not entirely accurate: using the CreateProcessW API, you could
> pass UTF-16. However, in order to make full use of arguments passed
> that way, the sub-program needs to forgo the normal “int main(int,
> char**)” signature and use “int _wmain(int, wchar_t**)”, or to call
> GetCommandLineW and parse the returned UTF-16 string. A sub-program
> that accepts arguments via the usual ‘main’ function will be limited
> to characters that are representable in the current codepage.

Not only does the sub-program need to use _wmain instead of main, it
must also internally use wchar_t data type instead of char for text
strings.  Ports of GNU and Unix software generally won't do that, so
passing UTF-16 encoded text to them is not really useful, with a few
very rare exceptions.



      reply	other threads:[~2018-07-12 13:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-11 23:02 Grep Japanese characters Tak Kunihiro
2018-07-12  2:40 ` Eli Zaretskii
2018-07-12  3:05   ` YUE Daian
2018-07-12 13:10     ` Tak Kunihiro
2018-07-12 13:37       ` Eli Zaretskii
2018-07-13  3:36         ` Tak Kunihiro
2018-07-13  7:21           ` Eli Zaretskii
2018-07-13 14:06             ` Filipp Gunbin
2018-07-13 14:36               ` Eli Zaretskii
2018-07-16 20:11                 ` Filipp Gunbin
2018-07-17  2:29                   ` Eli Zaretskii
2018-07-13  2:58       ` YUE Daian
2018-07-12 13:23     ` Eli Zaretskii
2018-07-12  5:05   ` Yuri Khan
2018-07-12 13:27     ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83601kfuu3.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).