Re: Rationale for aligning data on even bytes in a Unix shell file?

Liste des GroupesRevenir à cl c 
Sujet : Re: Rationale for aligning data on even bytes in a Unix shell file?
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.c
Date : 29. Apr 2025, 09:58:46
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vuq4c6$1ca4v$2@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 29/04/2025 01:13, Janis Papanagnou wrote:
On 28.04.2025 20:38, Bonita Montero wrote:
Am 28.04.2025 um 20:05 schrieb Janis Papanagnou:
>
(I thought Windows would use "UCS2". Anyway; would 16 bit suffice to
support full Unicode; I thought it wouldn't, or only old restricted
versions of Unicode.)
>
Windows is UTF-16 since Windows 2000, UCS2 before.
 
No, Windows has had /some/ UTF-16 support since W2K, with gradual improvements over time to APIs, filesystems, and applications.  Later on, it started getting /some/ UTF-8 support, which is a much better choice for most uses.

Oh, so it's a multi-word encoding (like UTF-8 is a multi-byte encoding)
and a character not necessarily encoded with only one 16 bit word... -
...but then I wonder even more where you see an advantage.
 
When Unicode started, they thought 16 bits would be enough.  UCS2 made sense then, because it was a fixed size encoding - though it had the huge disadvantages of being endian-dependent and totally incompatible with every existing character set.  Early Unicode adopters included Windows NT and NTFS, Java, QT and Python, using UCS2.
Once Unicode was extended beyond 16 bits, three new encodings emerged - UCS4 (32-bit fixed size), UTF-8 and UTF-16.  UCS4 has the advantage of being fixed size (that turns out to be a minor issue in practice, but was long thought to be important), but like UCS2 it suffers from endianness, and is inefficient in size (but is easily compressed, so that also does not matter as much as many people think).  UCS4 covers all code points in Unicode, but combining characters mean it still does not cover all characters in one code unit.
UTF-16 is variable length, and can encode any Unicode code point.  It has the advantage that existing UCS2 is a subset, making it a natural extension for UCS2 systems - but keeps the same disadvantages of inefficiency for common ASCII characters, incompatibility with ASCII, endian-dependent, and it requires dedicated functions for almost everything.
The biggest problem with UTF-16 IMHO is that it delayed adoption of UTF-8 on early Unicode software.  Changing something like QT or Windows from UCS2 to UTF-8 is not easy, but it would have been much better in the long run if that had been done without changing to UTF-16 first.

Date Sujet#  Auteur
26 Apr 25 * Rationale for aligning data on even bytes in a Unix shell file?147Janis Papanagnou
26 Apr 25 +* Re: Rationale for aligning data on even bytes in a Unix shell file?2Keith Thompson
27 Apr 25 i`- Re: Rationale for aligning data on even bytes in a Unix shell file?1Janis Papanagnou
27 Apr 25 +* Re: Rationale for aligning data on even bytes in a Unix shell file?2Kaz Kylheku
27 Apr 25 i`- Re: Rationale for aligning data on even bytes in a Unix shell file?1Janis Papanagnou
27 Apr 25 +* Re: Rationale for aligning data on even bytes in a Unix shell file?140Bonita Montero
27 Apr 25 i+* Re: Rationale for aligning data on even bytes in a Unix shell file?127Janis Papanagnou
28 Apr 25 ii`* Re: Rationale for aligning data on even bytes in a Unix shell file?126Bonita Montero
28 Apr 25 ii +* Re: Rationale for aligning data on even bytes in a Unix shell file?124vallor
28 Apr 25 ii i+* Re: Rationale for aligning data on even bytes in a Unix shell file?122Bonita Montero
28 Apr 25 ii ii`* Re: Rationale for aligning data on even bytes in a Unix shell file?121vallor
28 Apr 25 ii ii `* Re: Rationale for aligning data on even bytes in a Unix shell file?120Bonita Montero
28 Apr 25 ii ii  `* Re: Rationale for aligning data on even bytes in a Unix shell file?119Janis Papanagnou
28 Apr 25 ii ii   `* Re: Rationale for aligning data on even bytes in a Unix shell file?118Bonita Montero
28 Apr 25 ii ii    +* Re: Rationale for aligning data on even bytes in a Unix shell file?54Janis Papanagnou
28 Apr 25 ii ii    i`* Re: Rationale for aligning data on even bytes in a Unix shell file?53Bonita Montero
28 Apr 25 ii ii    i +* Re: Rationale for aligning data on even bytes in a Unix shell file?44Bonita Montero
28 Apr 25 ii ii    i i`* Re: Rationale for aligning data on even bytes in a Unix shell file?43Bonita Montero
28 Apr 25 ii ii    i i `* Re: Rationale for aligning data on even bytes in a Unix shell file?42Richard Harnden
28 Apr 25 ii ii    i i  `* Re: Rationale for aligning data on even bytes in a Unix shell file?41Bonita Montero
29 Apr 25 ii ii    i i   +* Re: Rationale for aligning data on even bytes in a Unix shell file?36Richard Heathfield
29 Apr 25 ii ii    i i   i+* Re: Rationale for aligning data on even bytes in a Unix shell file?33Bonita Montero
29 Apr 25 ii ii    i i   ii+* Re: Rationale for aligning data on even bytes in a Unix shell file?31Richard Heathfield
6 May 25 ii ii    i i   iii`* Re: Rationale for aligning data on even bytes in a Unix shell file?30Bonita Montero
7 May 25 ii ii    i i   iii `* Re: Rationale for aligning data on even bytes in a Unix shell file?29BGB
7 May 25 ii ii    i i   iii  +* Re: Rationale for aligning data on even bytes in a Unix shell file?18Janis Papanagnou
7 May 25 ii ii    i i   iii  i+* Re: Rationale for aligning data on even bytes in a Unix shell file?13Michael S
8 May 25 ii ii    i i   iii  ii+* Re: Rationale for aligning data on even bytes in a Unix shell file?11BGB
8 May 25 ii ii    i i   iii  iii`* Re: Rationale for aligning data on even bytes in a Unix shell file?10Janis Papanagnou
8 May 25 ii ii    i i   iii  iii `* Re: Rationale for aligning data on even bytes in a Unix shell file?9BGB
8 May 25 ii ii    i i   iii  iii  `* Re: Rationale for aligning data on even bytes in a Unix shell file?8Keith Thompson
9 May 25 ii ii    i i   iii  iii   `* Re: Rationale for aligning data on even bytes in a Unix shell file?7BGB
9 May 25 ii ii    i i   iii  iii    +* Re: Rationale for aligning data on even bytes in a Unix shell file?2Keith Thompson
9 May 25 ii ii    i i   iii  iii    i`- Re: Rationale for aligning data on even bytes in a Unix shell file?1Janis Papanagnou
9 May 25 ii ii    i i   iii  iii    `* Re: Rationale for aligning data on even bytes in a Unix shell file?4Lawrence D'Oliveiro
9 May 25 ii ii    i i   iii  iii     `* Re: Rationale for aligning data on even bytes in a Unix shell file?3BGB
15 May 25 ii ii    i i   iii  iii      `* Re: Rationale for aligning data on even bytes in a Unix shell file?2Lawrence D'Oliveiro
15 May 25 ii ii    i i   iii  iii       `- Re: Rationale for aligning data on even bytes in a Unix shell file?1BGB
9 May 25 ii ii    i i   iii  ii`- Re: Rationale for aligning data on even bytes in a Unix shell file?1Lawrence D'Oliveiro
7 May 25 ii ii    i i   iii  i`* Re: Rationale for aligning data on even bytes in a Unix shell file?4BGB
7 May 25 ii ii    i i   iii  i +* Re: Rationale for aligning data on even bytes in a Unix shell file?2David Brown
8 May 25 ii ii    i i   iii  i i`- Re: Rationale for aligning data on even bytes in a Unix shell file?1Janis Papanagnou
8 May 25 ii ii    i i   iii  i `- Re: Rationale for aligning data on even bytes in a Unix shell file?1Lawrence D'Oliveiro
8 May 25 ii ii    i i   iii  +* Re: Rationale for aligning data on even bytes in a Unix shell file?5Lawrence D'Oliveiro
8 May 25 ii ii    i i   iii  i`* Re: Rationale for aligning data on even bytes in a Unix shell file?4BGB
9 May 25 ii ii    i i   iii  i `* Re: Rationale for aligning data on even bytes in a Unix shell file?3Lawrence D'Oliveiro
9 May 25 ii ii    i i   iii  i  +- Re: Rationale for aligning data on even bytes in a Unix shell file?1BGB
9 May 25 ii ii    i i   iii  i  `- Re: Rationale for aligning data on even bytes in a Unix shell file?1Janis Papanagnou
9 May 25 ii ii    i i   iii  `* Re: Rationale for aligning data on even bytes in a Unix shell file?5Bonita Montero
9 May 25 ii ii    i i   iii   +* Re: Rationale for aligning data on even bytes in a Unix shell file?3BGB
9 May 25 ii ii    i i   iii   i`* Re: Rationale for aligning data on even bytes in a Unix shell file?2Keith Thompson
9 May 25 ii ii    i i   iii   i `- Re: Rationale for aligning data on even bytes in a Unix shell file?1BGB
14 May 25 ii ii    i i   iii   `- Re: Rationale for aligning data on even bytes in a Unix shell file?1Lawrence D'Oliveiro
29 Apr 25 ii ii    i i   ii`- Locales [was: Re: Rationale for aligning data on even bytes in a Unix shell file?]1Alexis
29 Apr 25 ii ii    i i   i`* Re: Rationale for aligning data on even bytes in a Unix shell file?2David Brown
29 Apr 25 ii ii    i i   i `- Re: Rationale for aligning data on even bytes in a Unix shell file?1Richard Heathfield
29 Apr 25 ii ii    i i   +- Re: Rationale for aligning data on even bytes in a Unix shell file?1James Kuyper
29 Apr 25 ii ii    i i   +* Re: Rationale for aligning data on even bytes in a Unix shell file?2Bonita Montero
5 May 25 ii ii    i i   i`- Re: Rationale for aligning data on even bytes in a Unix shell file?1Tim Rentsch
29 Apr 25 ii ii    i i   `- Re: Rationale for aligning data on even bytes in a Unix shell file?1Michael S
28 Apr 25 ii ii    i `* Re: Rationale for aligning data on even bytes in a Unix shell file?8Janis Papanagnou
28 Apr 25 ii ii    i  +- Re: Rationale for aligning data on even bytes in a Unix shell file?1Kaz Kylheku
28 Apr 25 ii ii    i  `* Re: Rationale for aligning data on even bytes in a Unix shell file?6Bonita Montero
29 Apr 25 ii ii    i   `* Re: Rationale for aligning data on even bytes in a Unix shell file?5Janis Papanagnou
29 Apr 25 ii ii    i    `* Re: Rationale for aligning data on even bytes in a Unix shell file?4David Brown
29 Apr 25 ii ii    i     `* Re: Rationale for aligning data on even bytes in a Unix shell file?3Muttley
29 Apr 25 ii ii    i      +- Re: Rationale for aligning data on even bytes in a Unix shell file?1David Brown
30 Apr 25 ii ii    i      `- Re: Rationale for aligning data on even bytes in a Unix shell file?1Lawrence D'Oliveiro
28 Apr 25 ii ii    +* Re: Rationale for aligning data on even bytes in a Unix shell file?54Muttley
28 Apr 25 ii ii    i`* Re: Rationale for aligning data on even bytes in a Unix shell file?53Bonita Montero
28 Apr 25 ii ii    i +* Re: Rationale for aligning data on even bytes in a Unix shell file?41Bonita Montero
28 Apr 25 ii ii    i i`* Re: Rationale for aligning data on even bytes in a Unix shell file?40Bonita Montero
28 Apr 25 ii ii    i i +* Re: Rationale for aligning data on even bytes in a Unix shell file?37Michael S
28 Apr 25 ii ii    i i i+* Re: Rationale for aligning data on even bytes in a Unix shell file?11Kaz Kylheku
28 Apr 25 ii ii    i i ii`* Re: Rationale for aligning data on even bytes in a Unix shell file?10Michael S
28 Apr 25 ii ii    i i ii +- Re: Rationale for aligning data on even bytes in a Unix shell file?1Kaz Kylheku
29 Apr 25 ii ii    i i ii `* Re: Rationale for aligning data on even bytes in a Unix shell file?8Lawrence D'Oliveiro
29 Apr 25 ii ii    i i ii  `* Re: Rationale for aligning data on even bytes in a Unix shell file?7Janis Papanagnou
29 Apr 25 ii ii    i i ii   `* Re: Rationale for aligning data on even bytes in a Unix shell file?6Michael S
30 Apr 25 ii ii    i i ii    `* Re: Rationale for aligning data on even bytes in a Unix shell file?5Lawrence D'Oliveiro
30 Apr 25 ii ii    i i ii     `* Re: Rationale for aligning data on even bytes in a Unix shell file?4Janis Papanagnou
30 Apr 25 ii ii    i i ii      `* Re: Rationale for aligning data on even bytes in a Unix shell file?3Janis Papanagnou
1 May 25 ii ii    i i ii       `* Re: Rationale for aligning data on even bytes in a Unix shell file?2Lew Pitcher
2 May 25 ii ii    i i ii        `- Re: Rationale for aligning data on even bytes in a Unix shell file?1Janis Papanagnou
28 Apr 25 ii ii    i i i+- Re: Rationale for aligning data on even bytes in a Unix shell file?1Michael S
29 Apr 25 ii ii    i i i`* Re: Rationale for aligning data on even bytes in a Unix shell file?24Muttley
30 Apr 25 ii ii    i i i `* Re: Rationale for aligning data on even bytes in a Unix shell file?23Lawrence D'Oliveiro
30 Apr 25 ii ii    i i i  `* Re: Rationale for aligning data on even bytes in a Unix shell file?22Muttley
30 Apr 25 ii ii    i i i   +* Re: Rationale for aligning data on even bytes in a Unix shell file?20David Brown
30 Apr 25 ii ii    i i i   i+* Re: Rationale for aligning data on even bytes in a Unix shell file?18Muttley
30 Apr 25 ii ii    i i i   ii+* Re: Rationale for aligning data on even bytes in a Unix shell file?4Janis Papanagnou
30 Apr 25 ii ii    i i i   iii+* Re: Rationale for aligning data on even bytes in a Unix shell file?2David Brown
30 Apr 25 ii ii    i i i   iiii`- Re: Rationale for aligning data on even bytes in a Unix shell file?1Janis Papanagnou
30 Apr 25 ii ii    i i i   iii`- Re: Rationale for aligning data on even bytes in a Unix shell file?1Muttley
30 Apr 25 ii ii    i i i   ii`* Re: Rationale for aligning data on even bytes in a Unix shell file?13David Brown
30 Apr 25 ii ii    i i i   ii +- Re: Rationale for aligning data on even bytes in a Unix shell file?1Janis Papanagnou
30 Apr 25 ii ii    i i i   ii `* Re: Rationale for aligning data on even bytes in a Unix shell file?11Muttley
1 May 25 ii ii    i i i   ii  `* Re: Rationale for aligning data on even bytes in a Unix shell file?10Lawrence D'Oliveiro
1 May 25 ii ii    i i i   ii   +- Re: Rationale for aligning data on even bytes in a Unix shell file?1vallor
1 May 25 ii ii    i i i   ii   +* Re: Rationale for aligning data on even bytes in a Unix shell file?7David Brown
6 May 25 ii ii    i i i   ii   i`* Re: Rationale for aligning data on even bytes in a Unix shell file?6BGB
2 May 25 ii ii    i i i   ii   `- Re: Rationale for aligning data on even bytes in a Unix shell file?1Janis Papanagnou
30 Apr 25 ii ii    i i i   i`- Re: Rationale for aligning data on even bytes in a Unix shell file?1Janis Papanagnou
30 Apr 25 ii ii    i i i   `- Re: Rationale for aligning data on even bytes in a Unix shell file?1Lawrence D'Oliveiro
28 Apr 25 ii ii    i i `* Re: Rationale for aligning data on even bytes in a Unix shell file?2Bonita Montero
28 Apr 25 ii ii    i `* Re: Rationale for aligning data on even bytes in a Unix shell file?11Muttley
29 Apr 25 ii ii    `* Re: Rationale for aligning data on even bytes in a Unix shell file?9Lawrence D'Oliveiro
28 Apr 25 ii i`- Re: Rationale for aligning data on even bytes in a Unix shell file?1vallor
28 Apr 25 ii `- Re: Rationale for aligning data on even bytes in a Unix shell file?1Janis Papanagnou
27 Apr 25 i+* Re: Rationale for aligning data on even bytes in a Unix shell file?2Kaz Kylheku
28 Apr 25 i+- Re: Rationale for aligning data on even bytes in a Unix shell file?1Kenny McCormack
28 Apr 25 i+- Re: Rationale for aligning data on even bytes in a Unix shell file?1Bonita Montero
28 Apr 25 i`* Re: Rationale for aligning data on even bytes in a Unix shell file?8Lawrence D'Oliveiro
9 May 25 `* Re: Rationale for aligning data on even bytes in a Unix shell file?2Keith Thompson

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal