From f81d6f68c6e3578d2f294f7daf7047986b677687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Fri, 30 Jan 2015 15:53:02 +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/trunk@78422 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 f25bc8849e..3f46ff1bb6 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -1243,6 +1243,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; @@ -1268,6 +1270,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" ); }