bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #65053] spurious "hexadecimal escape sequence out of range" warning


From: Bruno Haible
Subject: [bug #65053] spurious "hexadecimal escape sequence out of range" warnings
Date: Wed, 20 Dec 2023 13:37:56 -0500 (EST)

Follow-up Comment #3, bug#65053 (group gettext):


> it emits them even for literals that aren't used in i18n functions

Yes, that's because composition of literals happens before xgettext decides
whether to emit the sequence of literals into the resulting .pot file. I
acknowledge that it's a bit unfortunate. But it would require a complex logic
to make this warning appear only for strings that get extracted.

> emits warning on perfectly legal, standard-comformant C++ code

The problem behind that is that the expectations regarding xgettext are higher
than the expecations regarding a C++ compiler. The C++ compiler only needs to
put the string into a read-only portion of the resulting binary, and the
result in different locales on various platforms is then the user's business,
not the compiler writer's business. Whereas for xgettext the expectation is
that it transforms the literal into a byte sequence in the .po file, and that
this byte sequence is the correct one regardless of the locale at run-time and
regardless of the target platform. This is why I cannot ignore the problem
with FreeBSD and Solaris.

> there's a workaround ...: use \u instead of \x.

Indeed. And with this one there is no problem, because with \u the programmer
denoted the character in a locale and platform independent way.

Maybe I should change the warning "hexadecimal escape sequence out of range"
to "hexadecimal escape in wide-char literal is unsupported; use \u instead of
\x if you meant to designate a Unicode character" ?


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65053>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]