| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b7fe8c7 commit 646cadc
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -253,10 +253,10 @@ bool BuiltinLoader::Add(const char* id, std::string_view utf8source) { | |||
| 253 | 253 | size_t expected_u16_length = | |
| 254 | 254 | simdutf::utf16_length_from_utf8(utf8source.data(), utf8source.length()); | |
| 255 | 255 | auto out = std::make_shared<std::vector<uint16_t>>(expected_u16_length); | |
| 256 | - size_t u16_length = simdutf::convert_utf8_to_utf16le( | ||
| 257 | - utf8source.data(), | ||
| 258 | - utf8source.length(), | ||
| 259 | - reinterpret_cast<char16_t*>(out->data())); | ||
| 256 | + size_t u16_length = | ||
| 257 | + simdutf::convert_utf8_to_utf16(utf8source.data(), | ||
| 258 | + utf8source.length(), | ||
| 259 | + reinterpret_cast<char16_t*>(out->data())); | ||
| 260 | 260 | out->resize(u16_length); | |
| 261 | 261 | return Add(id, UnionBytes(out)); | |
| 262 | 262 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -299,17 +299,3 @@ TEST(UtilTest, SPrintF) { | |||
| 299 | 299 | const std::string with_zero = std::string("a") + '\0' + 'b'; | |
| 300 | 300 | EXPECT_EQ(SPrintF("%s", with_zero), with_zero); | |
| 301 | 301 | } | |
| 302 | - | ||
| 303 | - TEST(UtilTest, SimdutfEndiannessDoesNotMeanEndianness) { | ||
| 304 | - // In simdutf, "LE" does *not* refer to Little Endian, it refers | ||
| 305 | - // to 16-byte code units that are stored using *host* endianness. | ||
| 306 | - // This is weird and confusing naming, and so we add this assertion | ||
| 307 | - // here to verify that this is actually the case (so that CI tells | ||
| 308 | - // us if it changed, because for most people Little Endian is | ||
| 309 | - // host endianness, so locally everything would work fine). | ||
| 310 | - const char utf8source[] = "\xe7\x8c\xab"; | ||
| 311 | - char16_t u16output; | ||
| 312 | - size_t u16len = simdutf::convert_utf8_to_utf16le(utf8source, 3, &u16output); | ||
| 313 | - EXPECT_EQ(u16len, 1u); | ||
| 314 | - EXPECT_EQ(u16output, 0x732B); | ||
| 315 | - } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments