diff options
| author | Anthony <Helios747@users.noreply.github.com> | 2017-05-02 11:41:53 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-05-02 11:41:53 -0700 |
| commit | d4e424fad55d46a5c627b88c3d61f6c9137f6ac1 (patch) | |
| tree | 808ad3f5f21a7046841a5fcaf6fb24458086d6a6 /Source/UnitTests/Common/StringUtilTest.cpp | |
| parent | 252bb4471d41027aa5a06984a433f861a2e0e5e6 (diff) | |
| parent | e66ad018f40c1d7076989f3a5069404757d5479c (diff) | |
Merge pull request #5272 from spycrab/master
Convert VolumeDirectory names back to SHIFT-JIS (issue #9988)
Diffstat (limited to 'Source/UnitTests/Common/StringUtilTest.cpp')
| -rw-r--r-- | Source/UnitTests/Common/StringUtilTest.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/UnitTests/Common/StringUtilTest.cpp b/Source/UnitTests/Common/StringUtilTest.cpp index 98fdda1888..a0da5e672a 100644 --- a/Source/UnitTests/Common/StringUtilTest.cpp +++ b/Source/UnitTests/Common/StringUtilTest.cpp @@ -40,3 +40,12 @@ TEST(StringUtil, StringEndsWith) EXPECT_TRUE(StringEndsWith("abc", "")); EXPECT_TRUE(StringEndsWith("", "")); } + +TEST(StringUtil, UTF8ToSHIFTJIS) +{ + const std::string kirby_unicode = "\xe6\x98\x9f\xe3\x81\xae\xe3\x82\xab\xe3\x83\xbc\xe3\x83\x93\xe3\x82\xa3"; + const std::string kirby_sjis = "\x90\xaf\x82\xcc\x83\x4a\x81\x5b\x83\x72\x83\x42"; + + EXPECT_STREQ(SHIFTJISToUTF8(UTF8ToSHIFTJIS(kirby_unicode)).c_str(), kirby_unicode.c_str()); + EXPECT_STREQ(UTF8ToSHIFTJIS(kirby_unicode).c_str(), kirby_sjis.c_str()); +} |
