/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- * vim: set ts=8 sts=2 et sw=2 tw=80:
*/ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Make sure the behavior matches to encoding_rs.
len = mozilla::ConvertUtf8toUtf16(mozilla::Span(input, js_strlen(input)),
output);
CHECK(len == 1);
CHECK(outputBuf[0] == 0xFFFD);
}
// Partial sequence followed by ASCII range. // clang-format off constchar* inputs2[] = { "\xC2 ", "\xDF ", "\xE0 ", "\xE0\xA0 ", "\xF0 ", "\xF0\x90 ", "\xF0\x90\x80 ",
}; // clang-format on
// Partial sequence followed by other first code unit. // clang-format off constchar* inputs3[] = { "\xC2\xC2\x80", "\xDF\xC2\x80", "\xE0\xC2\x80", "\xE0\xA0\xC2\x80", "\xF0\xC2\x80", "\xF0\x90\xC2\x80", "\xF0\x90\x80\xC2\x80",
}; // clang-format on
// Invalid second byte, with not sufficient number of units. // clang-format off constchar* inputs5[] = { "\xE0\x9F\x80", "\xED\xA0\x80", "\xF0\x80\x80", "\xF4\x90\x80",
}; constchar* inputs6[] = { "\xE0\x9F", "\xED\xA0", "\xF0\x80", "\xF4\x90",
}; // clang-format on
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.