diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-04-22 15:36:32 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-04-22 15:36:32 +0100 |
commit | 6b2add5e70252c513f506f84cc386f47953df48d (patch) | |
tree | cb5390549936a81565de69ff5ce5039511a99db8 /dbus | |
parent | 540e5692e07d48fb41a4e977e0c9078fa19bd677 (diff) | |
download | dbus-6b2add5e70252c513f506f84cc386f47953df48d.tar.gz |
Accept non-characters when validating Unicode
Unicode Corrigendum #9 clarifies that the non-characters U+nFFFE
(for n in the range 0 to 0x10), U+nFFFF (for n in the same range),
and U+FDD0..U+FDEF are valid for interchange, and their presence
does not make a string ill-formed.
GLib 2.36 made the corresponding change in its definition of UTF-8
as used by g_utf8_validate() and similar functions.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63072
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'dbus')
-rw-r--r-- | dbus/dbus-string.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/dbus/dbus-string.c b/dbus/dbus-string.c index 9accdb19..e3766aad 100644 --- a/dbus/dbus-string.c +++ b/dbus/dbus-string.c @@ -1577,19 +1577,11 @@ _dbus_string_split_on_byte (DBusString *source, * * The second check covers surrogate pairs (category Cs). * - * The last two checks cover "Noncharacter": defined as: - * "A code point that is permanently reserved for - * internal use, and that should never be interchanged. In - * Unicode 3.1, these consist of the values U+nFFFE and U+nFFFF - * (where n is from 0 to 10_16) and the values U+FDD0..U+FDEF." - * * @param Char the character */ #define UNICODE_VALID(Char) \ ((Char) < 0x110000 && \ - (((Char) & 0xFFFFF800) != 0xD800) && \ - ((Char) < 0xFDD0 || (Char) > 0xFDEF) && \ - ((Char) & 0xFFFE) != 0xFFFE) + (((Char) & 0xFFFFF800) != 0xD800)) /** * Finds the given substring in the string, |