From 6e35d4bc6bb28df2a3bc684b19e81f78afda392c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Fri, 30 Jan 2015 15:53:17 +0000 Subject: [PATCH] Handle 5+ letter codes in TranslateFromUnicodeFormat() Unicode TR #35 v26 allows for five-letter (MMMMM) or even six-letter (EEEEEE) forms of some of the fields, but TranslateFromUnicodeFormat() asserts in these situations. Fix it to fall back to short forms for MMMMM and EEEEEE that are used in practice e.g. on OS X if the user has custom formatting settings. Consulting the table of sensible specifiers from http://userguide.icu-project.org/formatparse/datetime, it appears these two were the only omissions in this function. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78424 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/intl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/common/intl.cpp b/src/common/intl.cpp index f8b011a917..7c77e16b98 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -1251,6 +1251,8 @@ static wxString TranslateFromUnicodeFormat(const wxString& fmt) fmtWX += "%A"; break; case 5: // EEEEE + case 6: // EEEEEE + // no "narrow form" in strftime(), use abbrev. fmtWX += "%a"; break; @@ -1276,6 +1278,11 @@ static wxString TranslateFromUnicodeFormat(const wxString& fmt) fmtWX += "%B"; break; + case 5: + // no "narrow form" in strftime(), use abbrev. + fmtWX += "%b"; + break; + default: wxFAIL_MSG( "too many 'M's" ); }