[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: possible bugfix for CHAR_LEADING_CODE() for multibyte raw bytes
From: |
Danny McClanahan |
Subject: |
Re: possible bugfix for CHAR_LEADING_CODE() for multibyte raw bytes |
Date: |
Sat, 27 Jul 2024 12:27:54 +0000 |
> On Sunday, April 28th, 2024 at 10:20, Eli Zaretskii <eliz@gnu.org> wrote:
>
> 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?
I think you're right! I was very narrowly focused on the text of the code and
not the bits it was computing: it's definitely clear how that's computing just
the LSB there. I'm still getting more familiar with bit-level manipulation, but
I think that's clear enough now. I made this change in a branch and it hasn't
changed any behavior AFAICT.
Sorry for missing this reply--thanks so much for your thorough follow-up here!
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: possible bugfix for CHAR_LEADING_CODE() for multibyte raw bytes,
Danny McClanahan <=