From: <Paul.Koning@dell.com>
To: <eliz@gnu.org>
Cc: <simark@simark.ca>, <zjz@zjz.name>, <gdb-patches@sourceware.org>
Subject: Re: support C/C++ identifiers named with non-ASCII characters
Date: Mon, 21 May 2018 19:25:00 -0000 [thread overview]
Message-ID: <DFDB152A-578E-4FDE-8370-60CADCBD664C@dell.com> (raw)
In-Reply-To: <83tvr0ev0p.fsf@gnu.org>
> On May 21, 2018, at 2:14 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>
>> From: <Paul.Koning@dell.com>
>> CC: <simark@simark.ca>, <zjz@zjz.name>, <gdb-patches@sourceware.org>
>> Date: Mon, 21 May 2018 18:03:17 +0000
>>
>>> Is it a fact that non-ASCII identifiers must be encoded in UTF-8, and
>>> can not include invalid UTF-8 sequences?
>>
>> Encoding is a I/O question.
>
> Not necessarily.
>
> I asked that question because scanning a string for certain ASCII
> characters using a 'char *' pointer will only work reliably if the
> string is in UTF-8 or in some single-byte encoding. Otherwise, we
> might find false hits for the delimiters, which are actually parts of
> multibyte sequences.
I see your point.
The I/O encoding ties to the internal encoding. UTF-8 can be read into char[] and processed using C string primitives. Other encodings cannot. For example, if you have UTF-16 or UTF-32, you'd have to read it into a wchar_t string of the correct character width and use the wchar string functions.
So there are two questions:
1. What are the valid characters? (Unicode question, independent of encoding)
2. What encoding do we expect in I/O (UTF question) from which we conclude what processing functions we need.
paul
next prev parent reply other threads:[~2018-05-21 18:34 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-21 9:54 張俊芝
2018-05-21 14:21 ` Simon Marchi
2018-05-21 15:27 ` Paul.Koning
2018-05-21 16:16 ` Eli Zaretskii
2018-05-21 18:34 ` Paul.Koning
[not found] ` <83tvr0ev0p.fsf@gnu.org>
2018-05-21 19:25 ` Paul.Koning [this message]
2018-05-21 20:43 ` Joseph Myers
2018-05-22 10:31 ` 張俊芝
2018-05-22 8:34 ` 張俊芝
[not found] ` <1b915196-3e97-4892-7426-be4211fe7889@zjz.name>
2018-05-21 18:00 ` 張俊芝
2018-05-21 18:03 ` 張俊芝
2018-05-21 18:14 ` Matt Rice
2018-05-22 7:06 ` 張俊芝
2018-05-22 14:39 ` Pedro Alves
2018-05-22 14:39 ` 張俊芝
2018-05-22 15:17 ` Pedro Alves
2018-05-22 16:42 ` Pedro Alves
2018-05-22 17:31 ` 張俊芝
2018-05-22 17:38 ` Pedro Alves
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DFDB152A-578E-4FDE-8370-60CADCBD664C@dell.com \
--to=paul.koning@dell.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.ca \
--cc=zjz@zjz.name \
/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