summaryrefslogtreecommitdiff
path: root/Source/UnitTests/Common/StringUtilTest.cpp
diff options
context:
space:
mode:
authorspycrab <spycrab@users.noreply.github.com>2017-05-01 14:08:47 +0200
committerspycrab <spycrab@users.noreply.github.com>2017-05-01 14:08:47 +0200
commite66ad018f40c1d7076989f3a5069404757d5479c (patch)
tree5c2b0c0a89bb023776b7d9357105a013947013f9 /Source/UnitTests/Common/StringUtilTest.cpp
parent54dcd3a89b1aeae18f23d35193662f3d8770f37f (diff)
Convert VolumeDirectory names back to SHIFT-JIS (issue #9988)
Diffstat (limited to 'Source/UnitTests/Common/StringUtilTest.cpp')
-rw-r--r--Source/UnitTests/Common/StringUtilTest.cpp9
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());
+}