[pcre-dev] [Bug 1049] Add support for UTF-16

Startseite
Nachricht löschen
Autor: Petr Pisar
Datum:  
To: pcre-dev
Alte Treads: [pcre-dev] [Bug 1049] New: Add support for UTF-16
Betreff: [pcre-dev] [Bug 1049] Add support for UTF-16
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1049




--- Comment #26 from Petr Pisar <ppisar@???> 2011-11-16 08:51:18 ---
(In reply to comment #20)
> static const union { int i; char c; } order = { 1 }; /* initialisation assigns
> first union member */
>
> You can then simply check:
>
> if (order.c == 1) {
>    /* little endian */
> } else {
>    /* big endian */
> }

>

This wrongly assumes sizeof(int) != sizeof(char) and that both of them are
signed or unsigned.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email