[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: possible bugfix for CHAR_LEADING_CODE() for multibyte raw bytes
From: |
Eli Zaretskii |
Subject: |
Re: possible bugfix for CHAR_LEADING_CODE() for multibyte raw bytes |
Date: |
Sun, 28 Apr 2024 17:20:26 +0300 |
> Date: Sun, 28 Apr 2024 10:14:53 +0000
> From: Danny McClanahan <dmcc2@hypnicjerk.ai>
>
> While implementing the multibyte encoding scheme, I found what seemed to be
> an error in `CHAR_LEADING_CODE()` for raw bytes (multibyte codepoints encoded
> using two bytes which encode a single raw byte), where the multibyte code `c`
> isn't shifted downward the way it is in `char_string()` (see diff for fix at
> bottom).
Does the change you propose actually affect the result? The
"((c >> 6) & 0x01)" part takes just the LSB of (c >> 6), and
that doesn't seem to be affected by running c through
CHAR_TO_BYTE8, does it?
The leading byte of a multibyte sequence for raw bytes is either 0xC0
or 0xC1. That's what that part is trying to compute. Am I missing
something?