diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp @@ -11,6 +11,7 @@ // REQUIRES: locale.en_US.UTF-8 // REQUIRES: locale.fr_FR.UTF-8 +// REQUIRES: locale.ja_JP.UTF-8 // @@ -75,6 +76,18 @@ (ex == "Today is samedi which is abbreviated 'sam'." )|| (ex == "Today is samedi which is abbreviated 'sam.'.")); } - + { + const my_facet f(LOCALE_ja_JP_UTF_8, 1); + std::string pat("Today is %A which is the %uth day or alternatively %Ou."); + cpp17_output_iterator iter = + f.put(cpp17_output_iterator(str), ios, '*', &t, pat.data(), pat.data() + pat.size()); + std::string ex(str, base(iter)); +#if defined(_WIN32) || defined(__APPLE__) + // These platforms have no alternative + assert(ex == "Today is \xE5\x9C\x9F\xE6\x9B\x9C\xE6\x97\xA5 which is the 6th day or alternatively 6."); +#else + assert(ex == "Today is \xE5\x9C\x9F\xE6\x9B\x9C\xE6\x97\xA5 which is the 6th day or alternatively \xE5\x85\xAD."); +#endif + } return 0; } diff --git a/libcxx/test/support/platform_support.h b/libcxx/test/support/platform_support.h --- a/libcxx/test/support/platform_support.h +++ b/libcxx/test/support/platform_support.h @@ -28,6 +28,7 @@ # define LOCALE_fr_CA_ISO8859_1 "fr_CA.ISO8859-1" # define LOCALE_cs_CZ_ISO8859_2 "cs_CZ.ISO8859-2" #endif +#define LOCALE_ja_JP_UTF_8 "ja_JP.UTF-8" #define LOCALE_ru_RU_UTF_8 "ru_RU.UTF-8" #define LOCALE_zh_CN_UTF_8 "zh_CN.UTF-8" diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py --- a/libcxx/utils/libcxx/test/features.py +++ b/libcxx/utils/libcxx/test/features.py @@ -193,6 +193,7 @@ locales = { 'en_US.UTF-8': ['en_US.UTF-8', 'en_US.utf8', 'English_United States.1252'], 'fr_FR.UTF-8': ['fr_FR.UTF-8', 'fr_FR.utf8', 'French_France.1252'], + 'ja_JP.UTF-8': ['ja_JP.UTF-8', 'ja_JP.utf8', 'Japanese_Japan.923'], 'ru_RU.UTF-8': ['ru_RU.UTF-8', 'ru_RU.utf8', 'Russian_Russia.1251'], 'zh_CN.UTF-8': ['zh_CN.UTF-8', 'zh_CN.utf8', 'Chinese_China.936'], 'fr_CA.ISO8859-1': ['fr_CA.ISO8859-1', 'French_Canada.1252'],