From e9946ec98eb14f485a85f690fb41029d492b03a2 Mon Sep 17 00:00:00 2001 From: Jeff Genovy <29107334+jefgen@users.noreply.github.com> Date: Tue, 21 Mar 2017 01:03:49 +0000 Subject: [PATCH] ICU-13027 - Merge in changes from 'branches/shawnste/working/icu4c' X-SVN-Rev: 39890 --- .gitignore | 2 + icu4c/source/allinone/allinone.sln | 132 ++- icu4c/source/common/common_uwp.vcxproj | 1041 ++++++++++++++++++++++ icu4c/source/common/locmap.cpp | 270 +++++- icu4c/source/common/locmap.h | 3 +- icu4c/source/common/normlzr.cpp | 6 + icu4c/source/common/putil.cpp | 248 +++++- icu4c/source/common/putilimp.h | 6 + icu4c/source/common/ucln_imp.h | 2 + icu4c/source/common/udata.cpp | 17 +- icu4c/source/common/uloc.cpp | 14 + icu4c/source/common/uloc_tag.cpp | 2 +- icu4c/source/common/umapfile.cpp | 32 +- icu4c/source/common/umutex.h | 4 + icu4c/source/common/unicode/chariter.h | 4 + icu4c/source/common/unicode/platform.h | 12 + icu4c/source/common/unicode/uchriter.h | 4 + icu4c/source/common/unicode/uloc.h | 3 + icu4c/source/common/unicode/uvernum.h | 5 + icu4c/source/common/wintz.cpp | 7 +- icu4c/source/common/wintz.h | 6 +- icu4c/source/data/makedata.mak | 131 ++- icu4c/source/data/makedata.vcxproj | 18 +- icu4c/source/data/makedata_uwp.vcxproj | 137 +++ icu4c/source/i18n/i18n_uwp.vcxproj | 1020 +++++++++++++++++++++ icu4c/source/i18n/windtfmt.cpp | 109 ++- icu4c/source/i18n/windtfmt.h | 5 +- icu4c/source/i18n/winnmfmt.cpp | 169 +++- icu4c/source/i18n/winnmfmt.h | 3 +- icu4c/source/i18n/wintzimpl.cpp | 2 + icu4c/source/test/intltest/winutil.cpp | 2 + icu4c/source/tools/pkgdata/pkgdata.cpp | 58 +- icu4c/source/tools/toolutil/pkg_genc.cpp | 22 +- 33 files changed, 3283 insertions(+), 213 deletions(-) create mode 100644 icu4c/source/common/common_uwp.vcxproj create mode 100644 icu4c/source/data/makedata_uwp.vcxproj create mode 100644 icu4c/source/i18n/i18n_uwp.vcxproj diff --git a/.gitignore b/.gitignore index 161d9ff8280..17c4779f1e4 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ icu4c/source/common/*.o icu4c/source/common/*.plg icu4c/source/common/*.vcxproj.user icu4c/source/common/Debug +icu4c/source/common/Generated[!!-~]Files icu4c/source/common/Makefile icu4c/source/common/Makefile.local icu4c/source/common/Release @@ -102,6 +103,7 @@ icu4c/source/i18n/*.o icu4c/source/i18n/*.plg icu4c/source/i18n/*.vcxproj.user icu4c/source/i18n/Debug +icu4c/source/i18n/Generated[!!-~]Files icu4c/source/i18n/Makefile icu4c/source/i18n/Makefile.local icu4c/source/i18n/Release diff --git a/icu4c/source/allinone/allinone.sln b/icu4c/source/allinone/allinone.sln index fdaaea9c681..88a0d19744f 100644 --- a/icu4c/source/allinone/allinone.sln +++ b/icu4c/source/allinone/allinone.sln @@ -1,5 +1,7 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cal", "..\samples\cal\cal.vcxproj", "{F7659D77-09CF-4FE9-ACEE-927287AA9509}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cintltst", "..\test\cintltst\cintltst.vcxproj", "{3D1246AE-1B32-479B-BECA-AEFA97BE2321}" @@ -61,268 +63,354 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "icuinfo", "..\tools\icuinfo EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplug", "..\tools\icuinfo\testplug.vcxproj", "{659D0C08-D4ED-4BF3-B02B-2D8D4B5A7A7A}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "makedata_uwp", "..\data\makedata_uwp.vcxproj", "{B1D53358-37BD-48BC-B27C-68BAF1E78508}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "i18n_uwp", "..\i18n\i18n_uwp.vcxproj", "{6786C051-383B-47E0-9E82-B8B994E06A25}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common_uwp", "..\common\common_uwp.vcxproj", "{C10CF34B-3F79-430E-AD38-5A32DC0589C2}" +EndProject Global - GlobalSection(SubversionScc) = preSolution - Svn-Managed = True - Manager = AnkhSVN - Subversion Support for Visual Studio - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM = Debug|ARM Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 + Release|ARM = Release|ARM Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Debug|ARM.ActiveCfg = Debug|Win32 {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Debug|Win32.ActiveCfg = Debug|Win32 {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Debug|Win32.Build.0 = Debug|Win32 {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Debug|x64.ActiveCfg = Debug|x64 {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Debug|x64.Build.0 = Debug|x64 + {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Release|ARM.ActiveCfg = Release|Win32 {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Release|Win32.ActiveCfg = Release|Win32 {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Release|Win32.Build.0 = Release|Win32 {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Release|x64.ActiveCfg = Release|x64 {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Release|x64.Build.0 = Release|x64 + {3D1246AE-1B32-479B-BECA-AEFA97BE2321}.Debug|ARM.ActiveCfg = Debug|Win32 {3D1246AE-1B32-479B-BECA-AEFA97BE2321}.Debug|Win32.ActiveCfg = Debug|Win32 {3D1246AE-1B32-479B-BECA-AEFA97BE2321}.Debug|Win32.Build.0 = Debug|Win32 {3D1246AE-1B32-479B-BECA-AEFA97BE2321}.Debug|x64.ActiveCfg = Debug|x64 {3D1246AE-1B32-479B-BECA-AEFA97BE2321}.Debug|x64.Build.0 = Debug|x64 + {3D1246AE-1B32-479B-BECA-AEFA97BE2321}.Release|ARM.ActiveCfg = Release|Win32 {3D1246AE-1B32-479B-BECA-AEFA97BE2321}.Release|Win32.ActiveCfg = Release|Win32 {3D1246AE-1B32-479B-BECA-AEFA97BE2321}.Release|Win32.Build.0 = Release|Win32 {3D1246AE-1B32-479B-BECA-AEFA97BE2321}.Release|x64.ActiveCfg = Release|x64 {3D1246AE-1B32-479B-BECA-AEFA97BE2321}.Release|x64.Build.0 = Release|x64 + {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}.Debug|ARM.ActiveCfg = Debug|Win32 {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}.Debug|Win32.ActiveCfg = Debug|Win32 {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}.Debug|Win32.Build.0 = Debug|Win32 {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}.Debug|x64.ActiveCfg = Debug|x64 {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}.Debug|x64.Build.0 = Debug|x64 + {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}.Release|ARM.ActiveCfg = Release|Win32 {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}.Release|Win32.ActiveCfg = Release|Win32 {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}.Release|Win32.Build.0 = Release|Win32 {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}.Release|x64.ActiveCfg = Release|x64 {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}.Release|x64.Build.0 = Release|x64 + {ECA6B435-B4FA-4F9F-BF95-F451D078FC47}.Debug|ARM.ActiveCfg = Debug|Win32 {ECA6B435-B4FA-4F9F-BF95-F451D078FC47}.Debug|Win32.ActiveCfg = Debug|Win32 {ECA6B435-B4FA-4F9F-BF95-F451D078FC47}.Debug|Win32.Build.0 = Debug|Win32 {ECA6B435-B4FA-4F9F-BF95-F451D078FC47}.Debug|x64.ActiveCfg = Debug|x64 {ECA6B435-B4FA-4F9F-BF95-F451D078FC47}.Debug|x64.Build.0 = Debug|x64 + {ECA6B435-B4FA-4F9F-BF95-F451D078FC47}.Release|ARM.ActiveCfg = Release|Win32 {ECA6B435-B4FA-4F9F-BF95-F451D078FC47}.Release|Win32.ActiveCfg = Release|Win32 {ECA6B435-B4FA-4F9F-BF95-F451D078FC47}.Release|Win32.Build.0 = Release|Win32 {ECA6B435-B4FA-4F9F-BF95-F451D078FC47}.Release|x64.ActiveCfg = Release|x64 {ECA6B435-B4FA-4F9F-BF95-F451D078FC47}.Release|x64.Build.0 = Release|x64 + {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Debug|ARM.ActiveCfg = Debug|Win32 {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Debug|Win32.ActiveCfg = Debug|Win32 {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Debug|Win32.Build.0 = Debug|Win32 {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Debug|x64.ActiveCfg = Debug|x64 {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Debug|x64.Build.0 = Debug|x64 + {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Release|ARM.ActiveCfg = Release|Win32 {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Release|Win32.ActiveCfg = Release|Win32 {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Release|Win32.Build.0 = Release|Win32 {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Release|x64.ActiveCfg = Release|x64 {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Release|x64.Build.0 = Release|x64 + {D3065ADB-8820-4CC7-9B6C-9510833961A3}.Debug|ARM.ActiveCfg = Debug|Win32 {D3065ADB-8820-4CC7-9B6C-9510833961A3}.Debug|Win32.ActiveCfg = Debug|Win32 {D3065ADB-8820-4CC7-9B6C-9510833961A3}.Debug|Win32.Build.0 = Debug|Win32 {D3065ADB-8820-4CC7-9B6C-9510833961A3}.Debug|x64.ActiveCfg = Debug|x64 {D3065ADB-8820-4CC7-9B6C-9510833961A3}.Debug|x64.Build.0 = Debug|x64 + {D3065ADB-8820-4CC7-9B6C-9510833961A3}.Release|ARM.ActiveCfg = Release|Win32 {D3065ADB-8820-4CC7-9B6C-9510833961A3}.Release|Win32.ActiveCfg = Release|Win32 {D3065ADB-8820-4CC7-9B6C-9510833961A3}.Release|Win32.Build.0 = Release|Win32 {D3065ADB-8820-4CC7-9B6C-9510833961A3}.Release|x64.ActiveCfg = Release|x64 {D3065ADB-8820-4CC7-9B6C-9510833961A3}.Release|x64.Build.0 = Release|x64 + {C2BE5000-7501-4E87-9724-B8D82494FAE6}.Debug|ARM.ActiveCfg = Debug|Win32 {C2BE5000-7501-4E87-9724-B8D82494FAE6}.Debug|Win32.ActiveCfg = Debug|Win32 {C2BE5000-7501-4E87-9724-B8D82494FAE6}.Debug|Win32.Build.0 = Debug|Win32 {C2BE5000-7501-4E87-9724-B8D82494FAE6}.Debug|x64.ActiveCfg = Debug|x64 {C2BE5000-7501-4E87-9724-B8D82494FAE6}.Debug|x64.Build.0 = Debug|x64 + {C2BE5000-7501-4E87-9724-B8D82494FAE6}.Release|ARM.ActiveCfg = Release|Win32 {C2BE5000-7501-4E87-9724-B8D82494FAE6}.Release|Win32.ActiveCfg = Release|Win32 {C2BE5000-7501-4E87-9724-B8D82494FAE6}.Release|Win32.Build.0 = Release|Win32 {C2BE5000-7501-4E87-9724-B8D82494FAE6}.Release|x64.ActiveCfg = Release|x64 {C2BE5000-7501-4E87-9724-B8D82494FAE6}.Release|x64.Build.0 = Release|x64 + {FDD3C4F2-9805-44EB-9A77-BC1C1C95B547}.Debug|ARM.ActiveCfg = Debug|Win32 {FDD3C4F2-9805-44EB-9A77-BC1C1C95B547}.Debug|Win32.ActiveCfg = Debug|Win32 {FDD3C4F2-9805-44EB-9A77-BC1C1C95B547}.Debug|Win32.Build.0 = Debug|Win32 {FDD3C4F2-9805-44EB-9A77-BC1C1C95B547}.Debug|x64.ActiveCfg = Debug|x64 {FDD3C4F2-9805-44EB-9A77-BC1C1C95B547}.Debug|x64.Build.0 = Debug|x64 + {FDD3C4F2-9805-44EB-9A77-BC1C1C95B547}.Release|ARM.ActiveCfg = Release|Win32 {FDD3C4F2-9805-44EB-9A77-BC1C1C95B547}.Release|Win32.ActiveCfg = Release|Win32 {FDD3C4F2-9805-44EB-9A77-BC1C1C95B547}.Release|Win32.Build.0 = Release|Win32 {FDD3C4F2-9805-44EB-9A77-BC1C1C95B547}.Release|x64.ActiveCfg = Release|x64 {FDD3C4F2-9805-44EB-9A77-BC1C1C95B547}.Release|x64.Build.0 = Release|x64 + {A8D36F8D-09E6-4174-91C3-7BEAA9C3F04F}.Debug|ARM.ActiveCfg = Debug|Win32 {A8D36F8D-09E6-4174-91C3-7BEAA9C3F04F}.Debug|Win32.ActiveCfg = Debug|Win32 {A8D36F8D-09E6-4174-91C3-7BEAA9C3F04F}.Debug|Win32.Build.0 = Debug|Win32 {A8D36F8D-09E6-4174-91C3-7BEAA9C3F04F}.Debug|x64.ActiveCfg = Debug|x64 {A8D36F8D-09E6-4174-91C3-7BEAA9C3F04F}.Debug|x64.Build.0 = Debug|x64 + {A8D36F8D-09E6-4174-91C3-7BEAA9C3F04F}.Release|ARM.ActiveCfg = Release|Win32 {A8D36F8D-09E6-4174-91C3-7BEAA9C3F04F}.Release|Win32.ActiveCfg = Release|Win32 {A8D36F8D-09E6-4174-91C3-7BEAA9C3F04F}.Release|Win32.Build.0 = Release|Win32 {A8D36F8D-09E6-4174-91C3-7BEAA9C3F04F}.Release|x64.ActiveCfg = Release|x64 {A8D36F8D-09E6-4174-91C3-7BEAA9C3F04F}.Release|x64.Build.0 = Release|x64 + {8B41752B-5A52-41E4-B7E0-07921C0CC6BF}.Debug|ARM.ActiveCfg = Debug|Win32 {8B41752B-5A52-41E4-B7E0-07921C0CC6BF}.Debug|Win32.ActiveCfg = Debug|Win32 {8B41752B-5A52-41E4-B7E0-07921C0CC6BF}.Debug|Win32.Build.0 = Debug|Win32 {8B41752B-5A52-41E4-B7E0-07921C0CC6BF}.Debug|x64.ActiveCfg = Debug|x64 {8B41752B-5A52-41E4-B7E0-07921C0CC6BF}.Debug|x64.Build.0 = Debug|x64 + {8B41752B-5A52-41E4-B7E0-07921C0CC6BF}.Release|ARM.ActiveCfg = Release|Win32 {8B41752B-5A52-41E4-B7E0-07921C0CC6BF}.Release|Win32.ActiveCfg = Release|Win32 {8B41752B-5A52-41E4-B7E0-07921C0CC6BF}.Release|Win32.Build.0 = Release|Win32 {8B41752B-5A52-41E4-B7E0-07921C0CC6BF}.Release|x64.ActiveCfg = Release|x64 {8B41752B-5A52-41E4-B7E0-07921C0CC6BF}.Release|x64.Build.0 = Release|x64 + {97521D06-EC47-45D4-8BD0-9E16B3F93B2A}.Debug|ARM.ActiveCfg = Debug|Win32 {97521D06-EC47-45D4-8BD0-9E16B3F93B2A}.Debug|Win32.ActiveCfg = Debug|Win32 {97521D06-EC47-45D4-8BD0-9E16B3F93B2A}.Debug|Win32.Build.0 = Debug|Win32 {97521D06-EC47-45D4-8BD0-9E16B3F93B2A}.Debug|x64.ActiveCfg = Debug|x64 {97521D06-EC47-45D4-8BD0-9E16B3F93B2A}.Debug|x64.Build.0 = Debug|x64 + {97521D06-EC47-45D4-8BD0-9E16B3F93B2A}.Release|ARM.ActiveCfg = Release|Win32 {97521D06-EC47-45D4-8BD0-9E16B3F93B2A}.Release|Win32.ActiveCfg = Release|Win32 {97521D06-EC47-45D4-8BD0-9E16B3F93B2A}.Release|Win32.Build.0 = Release|Win32 {97521D06-EC47-45D4-8BD0-9E16B3F93B2A}.Release|x64.ActiveCfg = Release|x64 {97521D06-EC47-45D4-8BD0-9E16B3F93B2A}.Release|x64.Build.0 = Release|x64 + {77C78066-746F-4EA6-B3FE-B8C8A4A97891}.Debug|ARM.ActiveCfg = Debug|Win32 {77C78066-746F-4EA6-B3FE-B8C8A4A97891}.Debug|Win32.ActiveCfg = Debug|Win32 {77C78066-746F-4EA6-B3FE-B8C8A4A97891}.Debug|Win32.Build.0 = Debug|Win32 {77C78066-746F-4EA6-B3FE-B8C8A4A97891}.Debug|x64.ActiveCfg = Debug|x64 {77C78066-746F-4EA6-B3FE-B8C8A4A97891}.Debug|x64.Build.0 = Debug|x64 + {77C78066-746F-4EA6-B3FE-B8C8A4A97891}.Release|ARM.ActiveCfg = Release|Win32 {77C78066-746F-4EA6-B3FE-B8C8A4A97891}.Release|Win32.ActiveCfg = Release|Win32 {77C78066-746F-4EA6-B3FE-B8C8A4A97891}.Release|Win32.Build.0 = Release|Win32 {77C78066-746F-4EA6-B3FE-B8C8A4A97891}.Release|x64.ActiveCfg = Release|x64 {77C78066-746F-4EA6-B3FE-B8C8A4A97891}.Release|x64.Build.0 = Release|x64 + {0178B127-6269-407D-B112-93877BB62776}.Debug|ARM.ActiveCfg = Debug|Win32 {0178B127-6269-407D-B112-93877BB62776}.Debug|Win32.ActiveCfg = Debug|Win32 {0178B127-6269-407D-B112-93877BB62776}.Debug|Win32.Build.0 = Debug|Win32 {0178B127-6269-407D-B112-93877BB62776}.Debug|x64.ActiveCfg = Debug|x64 {0178B127-6269-407D-B112-93877BB62776}.Debug|x64.Build.0 = Debug|x64 + {0178B127-6269-407D-B112-93877BB62776}.Release|ARM.ActiveCfg = Release|Win32 {0178B127-6269-407D-B112-93877BB62776}.Release|Win32.ActiveCfg = Release|Win32 {0178B127-6269-407D-B112-93877BB62776}.Release|Win32.Build.0 = Release|Win32 {0178B127-6269-407D-B112-93877BB62776}.Release|x64.ActiveCfg = Release|x64 {0178B127-6269-407D-B112-93877BB62776}.Release|x64.Build.0 = Release|x64 + {73632960-B3A6-464D-83A3-4B43365F19B8}.Debug|ARM.ActiveCfg = Debug|Win32 {73632960-B3A6-464D-83A3-4B43365F19B8}.Debug|Win32.ActiveCfg = Debug|Win32 {73632960-B3A6-464D-83A3-4B43365F19B8}.Debug|Win32.Build.0 = Debug|Win32 {73632960-B3A6-464D-83A3-4B43365F19B8}.Debug|x64.ActiveCfg = Debug|x64 {73632960-B3A6-464D-83A3-4B43365F19B8}.Debug|x64.Build.0 = Debug|x64 + {73632960-B3A6-464D-83A3-4B43365F19B8}.Release|ARM.ActiveCfg = Release|Win32 {73632960-B3A6-464D-83A3-4B43365F19B8}.Release|Win32.ActiveCfg = Release|Win32 {73632960-B3A6-464D-83A3-4B43365F19B8}.Release|Win32.Build.0 = Release|Win32 {73632960-B3A6-464D-83A3-4B43365F19B8}.Release|x64.ActiveCfg = Release|x64 {73632960-B3A6-464D-83A3-4B43365F19B8}.Release|x64.Build.0 = Release|x64 - {C920062A-0647-4553-A3B2-37C58065664B}.Debug|Win32.ActiveCfg = Debug|Win32 - {C920062A-0647-4553-A3B2-37C58065664B}.Debug|Win32.Build.0 = Debug|Win32 - {C920062A-0647-4553-A3B2-37C58065664B}.Debug|x64.ActiveCfg = Debug|x64 - {C920062A-0647-4553-A3B2-37C58065664B}.Debug|x64.Build.0 = Debug|x64 - {C920062A-0647-4553-A3B2-37C58065664B}.Release|Win32.ActiveCfg = Release|Win32 - {C920062A-0647-4553-A3B2-37C58065664B}.Release|Win32.Build.0 = Release|Win32 - {C920062A-0647-4553-A3B2-37C58065664B}.Release|x64.ActiveCfg = Release|x64 - {C920062A-0647-4553-A3B2-37C58065664B}.Release|x64.Build.0 = Release|x64 - {37FC2C7F-1904-4811-8955-2F478830EAD1}.Debug|Win32.ActiveCfg = Debug|Win32 - {37FC2C7F-1904-4811-8955-2F478830EAD1}.Debug|Win32.Build.0 = Debug|Win32 - {37FC2C7F-1904-4811-8955-2F478830EAD1}.Debug|x64.ActiveCfg = Debug|x64 - {37FC2C7F-1904-4811-8955-2F478830EAD1}.Debug|x64.Build.0 = Debug|x64 - {37FC2C7F-1904-4811-8955-2F478830EAD1}.Release|Win32.ActiveCfg = Release|Win32 - {37FC2C7F-1904-4811-8955-2F478830EAD1}.Release|Win32.Build.0 = Release|Win32 - {37FC2C7F-1904-4811-8955-2F478830EAD1}.Release|x64.ActiveCfg = Release|x64 - {37FC2C7F-1904-4811-8955-2F478830EAD1}.Release|x64.Build.0 = Release|x64 + {F5AD9738-1A3D-4906-B9C4-A7D9CE33DC2C}.Debug|ARM.ActiveCfg = Debug|Win32 {F5AD9738-1A3D-4906-B9C4-A7D9CE33DC2C}.Debug|Win32.ActiveCfg = Debug|Win32 {F5AD9738-1A3D-4906-B9C4-A7D9CE33DC2C}.Debug|Win32.Build.0 = Debug|Win32 {F5AD9738-1A3D-4906-B9C4-A7D9CE33DC2C}.Debug|x64.ActiveCfg = Debug|x64 {F5AD9738-1A3D-4906-B9C4-A7D9CE33DC2C}.Debug|x64.Build.0 = Debug|x64 + {F5AD9738-1A3D-4906-B9C4-A7D9CE33DC2C}.Release|ARM.ActiveCfg = Release|Win32 {F5AD9738-1A3D-4906-B9C4-A7D9CE33DC2C}.Release|Win32.ActiveCfg = Release|Win32 {F5AD9738-1A3D-4906-B9C4-A7D9CE33DC2C}.Release|Win32.Build.0 = Release|Win32 {F5AD9738-1A3D-4906-B9C4-A7D9CE33DC2C}.Release|x64.ActiveCfg = Release|x64 {F5AD9738-1A3D-4906-B9C4-A7D9CE33DC2C}.Release|x64.Build.0 = Release|x64 + {D9DF7F2F-93B7-4810-B5CD-96F4F33C079B}.Debug|ARM.ActiveCfg = Debug|Win32 {D9DF7F2F-93B7-4810-B5CD-96F4F33C079B}.Debug|Win32.ActiveCfg = Debug|Win32 {D9DF7F2F-93B7-4810-B5CD-96F4F33C079B}.Debug|Win32.Build.0 = Debug|Win32 {D9DF7F2F-93B7-4810-B5CD-96F4F33C079B}.Debug|x64.ActiveCfg = Debug|x64 {D9DF7F2F-93B7-4810-B5CD-96F4F33C079B}.Debug|x64.Build.0 = Debug|x64 + {D9DF7F2F-93B7-4810-B5CD-96F4F33C079B}.Release|ARM.ActiveCfg = Release|Win32 {D9DF7F2F-93B7-4810-B5CD-96F4F33C079B}.Release|Win32.ActiveCfg = Release|Win32 {D9DF7F2F-93B7-4810-B5CD-96F4F33C079B}.Release|Win32.Build.0 = Release|Win32 {D9DF7F2F-93B7-4810-B5CD-96F4F33C079B}.Release|x64.ActiveCfg = Release|x64 {D9DF7F2F-93B7-4810-B5CD-96F4F33C079B}.Release|x64.Build.0 = Release|x64 + {4C8454FE-81D3-4CA3-9927-29BA96F03DAC}.Debug|ARM.ActiveCfg = Debug|Win32 {4C8454FE-81D3-4CA3-9927-29BA96F03DAC}.Debug|Win32.ActiveCfg = Debug|Win32 {4C8454FE-81D3-4CA3-9927-29BA96F03DAC}.Debug|Win32.Build.0 = Debug|Win32 {4C8454FE-81D3-4CA3-9927-29BA96F03DAC}.Debug|x64.ActiveCfg = Debug|x64 {4C8454FE-81D3-4CA3-9927-29BA96F03DAC}.Debug|x64.Build.0 = Debug|x64 + {4C8454FE-81D3-4CA3-9927-29BA96F03DAC}.Release|ARM.ActiveCfg = Release|Win32 {4C8454FE-81D3-4CA3-9927-29BA96F03DAC}.Release|Win32.ActiveCfg = Release|Win32 {4C8454FE-81D3-4CA3-9927-29BA96F03DAC}.Release|Win32.Build.0 = Release|Win32 {4C8454FE-81D3-4CA3-9927-29BA96F03DAC}.Release|x64.ActiveCfg = Release|x64 {4C8454FE-81D3-4CA3-9927-29BA96F03DAC}.Release|x64.Build.0 = Release|x64 + {203EC78A-0531-43F0-A636-285439BDE025}.Debug|ARM.ActiveCfg = Debug|Win32 {203EC78A-0531-43F0-A636-285439BDE025}.Debug|Win32.ActiveCfg = Debug|Win32 {203EC78A-0531-43F0-A636-285439BDE025}.Debug|Win32.Build.0 = Debug|Win32 {203EC78A-0531-43F0-A636-285439BDE025}.Debug|x64.ActiveCfg = Debug|x64 {203EC78A-0531-43F0-A636-285439BDE025}.Debug|x64.Build.0 = Debug|x64 + {203EC78A-0531-43F0-A636-285439BDE025}.Release|ARM.ActiveCfg = Release|Win32 {203EC78A-0531-43F0-A636-285439BDE025}.Release|Win32.ActiveCfg = Release|Win32 {203EC78A-0531-43F0-A636-285439BDE025}.Release|Win32.Build.0 = Release|Win32 {203EC78A-0531-43F0-A636-285439BDE025}.Release|x64.ActiveCfg = Release|x64 {203EC78A-0531-43F0-A636-285439BDE025}.Release|x64.Build.0 = Release|x64 + {6B231032-3CB5-4EED-9210-810D666A23A0}.Debug|ARM.ActiveCfg = Debug|Win32 {6B231032-3CB5-4EED-9210-810D666A23A0}.Debug|Win32.ActiveCfg = Debug|Win32 {6B231032-3CB5-4EED-9210-810D666A23A0}.Debug|Win32.Build.0 = Debug|Win32 {6B231032-3CB5-4EED-9210-810D666A23A0}.Debug|x64.ActiveCfg = Debug|x64 {6B231032-3CB5-4EED-9210-810D666A23A0}.Debug|x64.Build.0 = Debug|x64 + {6B231032-3CB5-4EED-9210-810D666A23A0}.Release|ARM.ActiveCfg = Release|Win32 {6B231032-3CB5-4EED-9210-810D666A23A0}.Release|Win32.ActiveCfg = Release|Win32 {6B231032-3CB5-4EED-9210-810D666A23A0}.Release|Win32.Build.0 = Release|Win32 {6B231032-3CB5-4EED-9210-810D666A23A0}.Release|x64.ActiveCfg = Release|x64 {6B231032-3CB5-4EED-9210-810D666A23A0}.Release|x64.Build.0 = Release|x64 + {DBA4088D-F6F9-4F8F-8820-082A4765C16C}.Debug|ARM.ActiveCfg = Debug|Win32 {DBA4088D-F6F9-4F8F-8820-082A4765C16C}.Debug|Win32.ActiveCfg = Debug|Win32 {DBA4088D-F6F9-4F8F-8820-082A4765C16C}.Debug|Win32.Build.0 = Debug|Win32 {DBA4088D-F6F9-4F8F-8820-082A4765C16C}.Debug|x64.ActiveCfg = Debug|x64 {DBA4088D-F6F9-4F8F-8820-082A4765C16C}.Debug|x64.Build.0 = Debug|x64 + {DBA4088D-F6F9-4F8F-8820-082A4765C16C}.Release|ARM.ActiveCfg = Release|Win32 {DBA4088D-F6F9-4F8F-8820-082A4765C16C}.Release|Win32.ActiveCfg = Release|Win32 {DBA4088D-F6F9-4F8F-8820-082A4765C16C}.Release|Win32.Build.0 = Release|Win32 {DBA4088D-F6F9-4F8F-8820-082A4765C16C}.Release|x64.ActiveCfg = Release|x64 {DBA4088D-F6F9-4F8F-8820-082A4765C16C}.Release|x64.Build.0 = Release|x64 + {C2B04507-2521-4801-BF0D-5FD79D6D518C}.Debug|ARM.ActiveCfg = Debug|Win32 {C2B04507-2521-4801-BF0D-5FD79D6D518C}.Debug|Win32.ActiveCfg = Debug|Win32 {C2B04507-2521-4801-BF0D-5FD79D6D518C}.Debug|Win32.Build.0 = Debug|Win32 {C2B04507-2521-4801-BF0D-5FD79D6D518C}.Debug|x64.ActiveCfg = Debug|x64 {C2B04507-2521-4801-BF0D-5FD79D6D518C}.Debug|x64.Build.0 = Debug|x64 + {C2B04507-2521-4801-BF0D-5FD79D6D518C}.Release|ARM.ActiveCfg = Release|Win32 {C2B04507-2521-4801-BF0D-5FD79D6D518C}.Release|Win32.ActiveCfg = Release|Win32 {C2B04507-2521-4801-BF0D-5FD79D6D518C}.Release|Win32.Build.0 = Release|Win32 {C2B04507-2521-4801-BF0D-5FD79D6D518C}.Release|x64.ActiveCfg = Release|x64 {C2B04507-2521-4801-BF0D-5FD79D6D518C}.Release|x64.Build.0 = Release|x64 + {631C23CE-6C1D-4875-88F0-85E0A42B36EA}.Debug|ARM.ActiveCfg = Debug|Win32 {631C23CE-6C1D-4875-88F0-85E0A42B36EA}.Debug|Win32.ActiveCfg = Debug|Win32 {631C23CE-6C1D-4875-88F0-85E0A42B36EA}.Debug|Win32.Build.0 = Debug|Win32 {631C23CE-6C1D-4875-88F0-85E0A42B36EA}.Debug|x64.ActiveCfg = Debug|x64 {631C23CE-6C1D-4875-88F0-85E0A42B36EA}.Debug|x64.Build.0 = Debug|x64 + {631C23CE-6C1D-4875-88F0-85E0A42B36EA}.Release|ARM.ActiveCfg = Release|Win32 {631C23CE-6C1D-4875-88F0-85E0A42B36EA}.Release|Win32.ActiveCfg = Release|Win32 {631C23CE-6C1D-4875-88F0-85E0A42B36EA}.Release|Win32.Build.0 = Release|Win32 {631C23CE-6C1D-4875-88F0-85E0A42B36EA}.Release|x64.ActiveCfg = Release|x64 {631C23CE-6C1D-4875-88F0-85E0A42B36EA}.Release|x64.Build.0 = Release|x64 + {E4993E82-D68A-46CA-BAE0-9D35E172E46F}.Debug|ARM.ActiveCfg = Debug|Win32 {E4993E82-D68A-46CA-BAE0-9D35E172E46F}.Debug|Win32.ActiveCfg = Debug|Win32 {E4993E82-D68A-46CA-BAE0-9D35E172E46F}.Debug|Win32.Build.0 = Debug|Win32 {E4993E82-D68A-46CA-BAE0-9D35E172E46F}.Debug|x64.ActiveCfg = Debug|x64 {E4993E82-D68A-46CA-BAE0-9D35E172E46F}.Debug|x64.Build.0 = Debug|x64 + {E4993E82-D68A-46CA-BAE0-9D35E172E46F}.Release|ARM.ActiveCfg = Release|Win32 {E4993E82-D68A-46CA-BAE0-9D35E172E46F}.Release|Win32.ActiveCfg = Release|Win32 {E4993E82-D68A-46CA-BAE0-9D35E172E46F}.Release|Win32.Build.0 = Release|Win32 {E4993E82-D68A-46CA-BAE0-9D35E172E46F}.Release|x64.ActiveCfg = Release|x64 {E4993E82-D68A-46CA-BAE0-9D35E172E46F}.Release|x64.Build.0 = Release|x64 + {62D4B15D-7A90-4ECB-BA19-5E021D6A21BC}.Debug|ARM.ActiveCfg = Debug|Win32 {62D4B15D-7A90-4ECB-BA19-5E021D6A21BC}.Debug|Win32.ActiveCfg = Debug|Win32 {62D4B15D-7A90-4ECB-BA19-5E021D6A21BC}.Debug|Win32.Build.0 = Debug|Win32 {62D4B15D-7A90-4ECB-BA19-5E021D6A21BC}.Debug|x64.ActiveCfg = Debug|x64 {62D4B15D-7A90-4ECB-BA19-5E021D6A21BC}.Debug|x64.Build.0 = Debug|x64 + {62D4B15D-7A90-4ECB-BA19-5E021D6A21BC}.Release|ARM.ActiveCfg = Release|Win32 {62D4B15D-7A90-4ECB-BA19-5E021D6A21BC}.Release|Win32.ActiveCfg = Release|Win32 {62D4B15D-7A90-4ECB-BA19-5E021D6A21BC}.Release|Win32.Build.0 = Release|Win32 {62D4B15D-7A90-4ECB-BA19-5E021D6A21BC}.Release|x64.ActiveCfg = Release|x64 {62D4B15D-7A90-4ECB-BA19-5E021D6A21BC}.Release|x64.Build.0 = Release|x64 + {9D4211F7-2C77-439C-82F0-30A4E43BA569}.Debug|ARM.ActiveCfg = Debug|Win32 {9D4211F7-2C77-439C-82F0-30A4E43BA569}.Debug|Win32.ActiveCfg = Debug|Win32 {9D4211F7-2C77-439C-82F0-30A4E43BA569}.Debug|Win32.Build.0 = Debug|Win32 {9D4211F7-2C77-439C-82F0-30A4E43BA569}.Debug|x64.ActiveCfg = Debug|x64 {9D4211F7-2C77-439C-82F0-30A4E43BA569}.Debug|x64.Build.0 = Debug|x64 + {9D4211F7-2C77-439C-82F0-30A4E43BA569}.Release|ARM.ActiveCfg = Release|Win32 {9D4211F7-2C77-439C-82F0-30A4E43BA569}.Release|Win32.ActiveCfg = Release|Win32 {9D4211F7-2C77-439C-82F0-30A4E43BA569}.Release|Win32.Build.0 = Release|Win32 {9D4211F7-2C77-439C-82F0-30A4E43BA569}.Release|x64.ActiveCfg = Release|x64 {9D4211F7-2C77-439C-82F0-30A4E43BA569}.Release|x64.Build.0 = Release|x64 + {691EE0C0-DC57-4A48-8AEE-8ED75EB3A057}.Debug|ARM.ActiveCfg = Debug|Win32 {691EE0C0-DC57-4A48-8AEE-8ED75EB3A057}.Debug|Win32.ActiveCfg = Debug|Win32 {691EE0C0-DC57-4A48-8AEE-8ED75EB3A057}.Debug|Win32.Build.0 = Debug|Win32 {691EE0C0-DC57-4A48-8AEE-8ED75EB3A057}.Debug|x64.ActiveCfg = Debug|x64 {691EE0C0-DC57-4A48-8AEE-8ED75EB3A057}.Debug|x64.Build.0 = Debug|x64 + {691EE0C0-DC57-4A48-8AEE-8ED75EB3A057}.Release|ARM.ActiveCfg = Release|Win32 {691EE0C0-DC57-4A48-8AEE-8ED75EB3A057}.Release|Win32.ActiveCfg = Release|Win32 {691EE0C0-DC57-4A48-8AEE-8ED75EB3A057}.Release|Win32.Build.0 = Release|Win32 {691EE0C0-DC57-4A48-8AEE-8ED75EB3A057}.Release|x64.ActiveCfg = Release|x64 {691EE0C0-DC57-4A48-8AEE-8ED75EB3A057}.Release|x64.Build.0 = Release|x64 + {C7891A65-80AB-4245-912E-5F1E17B0E6C4}.Debug|ARM.ActiveCfg = Debug|Win32 {C7891A65-80AB-4245-912E-5F1E17B0E6C4}.Debug|Win32.ActiveCfg = Debug|Win32 {C7891A65-80AB-4245-912E-5F1E17B0E6C4}.Debug|Win32.Build.0 = Debug|Win32 {C7891A65-80AB-4245-912E-5F1E17B0E6C4}.Debug|x64.ActiveCfg = Debug|x64 {C7891A65-80AB-4245-912E-5F1E17B0E6C4}.Debug|x64.Build.0 = Debug|x64 + {C7891A65-80AB-4245-912E-5F1E17B0E6C4}.Release|ARM.ActiveCfg = Release|Win32 {C7891A65-80AB-4245-912E-5F1E17B0E6C4}.Release|Win32.ActiveCfg = Release|Win32 {C7891A65-80AB-4245-912E-5F1E17B0E6C4}.Release|Win32.Build.0 = Release|Win32 {C7891A65-80AB-4245-912E-5F1E17B0E6C4}.Release|x64.ActiveCfg = Release|x64 {C7891A65-80AB-4245-912E-5F1E17B0E6C4}.Release|x64.Build.0 = Release|x64 + {E7611F49-F088-4175-9446-6111444E72C8}.Debug|ARM.ActiveCfg = Debug|Win32 {E7611F49-F088-4175-9446-6111444E72C8}.Debug|Win32.ActiveCfg = Debug|Win32 {E7611F49-F088-4175-9446-6111444E72C8}.Debug|Win32.Build.0 = Debug|Win32 {E7611F49-F088-4175-9446-6111444E72C8}.Debug|x64.ActiveCfg = Debug|x64 {E7611F49-F088-4175-9446-6111444E72C8}.Debug|x64.Build.0 = Debug|x64 + {E7611F49-F088-4175-9446-6111444E72C8}.Release|ARM.ActiveCfg = Release|Win32 {E7611F49-F088-4175-9446-6111444E72C8}.Release|Win32.ActiveCfg = Release|Win32 {E7611F49-F088-4175-9446-6111444E72C8}.Release|Win32.Build.0 = Release|Win32 {E7611F49-F088-4175-9446-6111444E72C8}.Release|x64.ActiveCfg = Release|x64 {E7611F49-F088-4175-9446-6111444E72C8}.Release|x64.Build.0 = Release|x64 + {659D0C08-D4ED-4BF3-B02B-2D8D4B5A7A7A}.Debug|ARM.ActiveCfg = Debug|Win32 {659D0C08-D4ED-4BF3-B02B-2D8D4B5A7A7A}.Debug|Win32.ActiveCfg = Debug|Win32 {659D0C08-D4ED-4BF3-B02B-2D8D4B5A7A7A}.Debug|Win32.Build.0 = Debug|Win32 {659D0C08-D4ED-4BF3-B02B-2D8D4B5A7A7A}.Debug|x64.ActiveCfg = Debug|x64 {659D0C08-D4ED-4BF3-B02B-2D8D4B5A7A7A}.Debug|x64.Build.0 = Debug|x64 + {659D0C08-D4ED-4BF3-B02B-2D8D4B5A7A7A}.Release|ARM.ActiveCfg = Release|Win32 {659D0C08-D4ED-4BF3-B02B-2D8D4B5A7A7A}.Release|Win32.ActiveCfg = Release|Win32 {659D0C08-D4ED-4BF3-B02B-2D8D4B5A7A7A}.Release|Win32.Build.0 = Release|Win32 {659D0C08-D4ED-4BF3-B02B-2D8D4B5A7A7A}.Release|x64.ActiveCfg = Release|x64 {659D0C08-D4ED-4BF3-B02B-2D8D4B5A7A7A}.Release|x64.Build.0 = Release|x64 + {B1D53358-37BD-48BC-B27C-68BAF1E78508}.Debug|ARM.ActiveCfg = Debug|ARM + {B1D53358-37BD-48BC-B27C-68BAF1E78508}.Debug|ARM.Build.0 = Debug|ARM + {B1D53358-37BD-48BC-B27C-68BAF1E78508}.Debug|Win32.ActiveCfg = Debug|Win32 + {B1D53358-37BD-48BC-B27C-68BAF1E78508}.Debug|Win32.Build.0 = Debug|Win32 + {B1D53358-37BD-48BC-B27C-68BAF1E78508}.Debug|x64.ActiveCfg = Debug|x64 + {B1D53358-37BD-48BC-B27C-68BAF1E78508}.Debug|x64.Build.0 = Debug|x64 + {B1D53358-37BD-48BC-B27C-68BAF1E78508}.Release|ARM.ActiveCfg = Release|ARM + {B1D53358-37BD-48BC-B27C-68BAF1E78508}.Release|ARM.Build.0 = Release|ARM + {B1D53358-37BD-48BC-B27C-68BAF1E78508}.Release|Win32.ActiveCfg = Release|Win32 + {B1D53358-37BD-48BC-B27C-68BAF1E78508}.Release|Win32.Build.0 = Release|Win32 + {B1D53358-37BD-48BC-B27C-68BAF1E78508}.Release|x64.ActiveCfg = Release|x64 + {B1D53358-37BD-48BC-B27C-68BAF1E78508}.Release|x64.Build.0 = Release|x64 + {6786C051-383B-47E0-9E82-B8B994E06A25}.Debug|ARM.ActiveCfg = Debug|ARM + {6786C051-383B-47E0-9E82-B8B994E06A25}.Debug|ARM.Build.0 = Debug|ARM + {6786C051-383B-47E0-9E82-B8B994E06A25}.Debug|Win32.ActiveCfg = Debug|Win32 + {6786C051-383B-47E0-9E82-B8B994E06A25}.Debug|Win32.Build.0 = Debug|Win32 + {6786C051-383B-47E0-9E82-B8B994E06A25}.Debug|x64.ActiveCfg = Debug|x64 + {6786C051-383B-47E0-9E82-B8B994E06A25}.Debug|x64.Build.0 = Debug|x64 + {6786C051-383B-47E0-9E82-B8B994E06A25}.Release|ARM.ActiveCfg = Release|ARM + {6786C051-383B-47E0-9E82-B8B994E06A25}.Release|ARM.Build.0 = Release|ARM + {6786C051-383B-47E0-9E82-B8B994E06A25}.Release|Win32.ActiveCfg = Release|Win32 + {6786C051-383B-47E0-9E82-B8B994E06A25}.Release|Win32.Build.0 = Release|Win32 + {6786C051-383B-47E0-9E82-B8B994E06A25}.Release|x64.ActiveCfg = Release|x64 + {6786C051-383B-47E0-9E82-B8B994E06A25}.Release|x64.Build.0 = Release|x64 + {C10CF34B-3F79-430E-AD38-5A32DC0589C2}.Debug|ARM.ActiveCfg = Debug|ARM + {C10CF34B-3F79-430E-AD38-5A32DC0589C2}.Debug|ARM.Build.0 = Debug|ARM + {C10CF34B-3F79-430E-AD38-5A32DC0589C2}.Debug|Win32.ActiveCfg = Debug|Win32 + {C10CF34B-3F79-430E-AD38-5A32DC0589C2}.Debug|Win32.Build.0 = Debug|Win32 + {C10CF34B-3F79-430E-AD38-5A32DC0589C2}.Debug|x64.ActiveCfg = Debug|x64 + {C10CF34B-3F79-430E-AD38-5A32DC0589C2}.Debug|x64.Build.0 = Debug|x64 + {C10CF34B-3F79-430E-AD38-5A32DC0589C2}.Release|ARM.ActiveCfg = Release|ARM + {C10CF34B-3F79-430E-AD38-5A32DC0589C2}.Release|ARM.Build.0 = Release|ARM + {C10CF34B-3F79-430E-AD38-5A32DC0589C2}.Release|Win32.ActiveCfg = Release|Win32 + {C10CF34B-3F79-430E-AD38-5A32DC0589C2}.Release|Win32.Build.0 = Release|Win32 + {C10CF34B-3F79-430E-AD38-5A32DC0589C2}.Release|x64.ActiveCfg = Release|x64 + {C10CF34B-3F79-430E-AD38-5A32DC0589C2}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(SubversionScc) = preSolution + Svn-Managed = True + Manager = AnkhSVN - Subversion Support for Visual Studio + EndGlobalSection EndGlobal diff --git a/icu4c/source/common/common_uwp.vcxproj b/icu4c/source/common/common_uwp.vcxproj new file mode 100644 index 00000000000..d3d9f8ae888 --- /dev/null +++ b/icu4c/source/common/common_uwp.vcxproj @@ -0,0 +1,1041 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Debug + ARM + + + Release + Win32 + + + Release + x64 + + + Release + ARM + + + + {C10CF34B-3F79-430E-AD38-5A32DC0589C2} + DynamicLibrary + en-US + 14.0 + true + Windows Store + 10.0.10586.0 + 10.0.10240.0 + 10.0 + + + + DynamicLibrary + false + MultiByte + v140 + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + .\x86\ReleaseUWP\ + .\x86\ReleaseUWP\ + .\x86\DebugUWP\ + .\x86\DebugUWP\ + .\x64\ReleaseUWP\ + .\x64\ReleaseUWP\ + .\x64\DebugUWP\ + .\x64\DebugUWP\ + .\arm\ReleaseUWP\ + .\arm\ReleaseUWP\ + .\arm\DebugUWP\ + .\arm\DebugUWP\ + false + true + + + + U_DISABLE_RENAMING=1;U_PLATFORM_HAS_WINUWP_API=1;%(PreprocessorDefinitions) + true + true + + + ..\..\include;..\common;%(AdditionalIncludeDirectories) + + U_DISABLE_RENAMING=1;U_PLATFORM_HAS_WINUWP_API=1;U_ATTRIBUTE_DEPRECATED=;_CRT_SECURE_NO_DEPRECATE;U_COMMON_IMPLEMENTATION;U_PLATFORM_USES_ONLY_WIN32_API=1;%(PreprocessorDefinitions) + true + + + true + false + true + Level3 + true + Default + NotUsing + false + /utf-8 %(AdditionalOptions) + + + U_DISABLE_RENAMING=1;U_PLATFORM_HAS_WINUWP_API=1;%(PreprocessorDefinitions) + 0x0409 + ../common;%(AdditionalIncludeDirectories) + + + true + false + true + + + true + vccorlib.lib;msvcrt.lib + + + + + NDEBUG;%(PreprocessorDefinitions) + + + NDEBUG;%(PreprocessorDefinitions) + MultiThreadedDLL + + + NDEBUG;%(PreprocessorDefinitions) + + + true + + + + + _DEBUG;%(PreprocessorDefinitions) + + + _DEBUG;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Disabled + EnableFastChecks + true + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + + + + + Win32 + + + WIN32;%(PreprocessorDefinitions) + + + + + X64 + + + WIN64;WIN32;%(PreprocessorDefinitions) + + + MachineX64 + + + + + ARM + + + ARM;WIN32;%(PreprocessorDefinitions) + + + MachineARM + + + + + .\..\..\lib32uwp\icuuc.tlb + + + .\x86\ReleaseUWP/common.pch + .\x86\ReleaseUWP/ + .\x86\ReleaseUWP/ + .\x86\ReleaseUWP/ + + + ..\..\bin32uwp\icuuc.dll + .\..\..\lib32uwp\icuuc.pdb + ..\..\lib32uwp\icuuc.lib + vccorlib.lib;WindowsApp.lib;msvcrt.lib;%(AdditionalDependencies) + + + + + .\..\..\lib32uwp\icuucd.tlb + + + .\x86\DebugUWP/common.pch + .\x86\DebugUWP/ + .\x86\DebugUWP/ + .\x86\DebugUWP/ + + + ..\..\bin32uwp\icuucd.dll + .\..\..\lib32uwp\icuucd.pdb + ..\..\lib32uwp\icuucd.lib + vccorlibd.lib;WindowsApp.lib;msvcrtd.lib;%(AdditionalDependencies) + + + + + .\..\..\lib64uwp\icuuc.tlb + + + .\x64\ReleaseUWP/common.pch + .\x64\ReleaseUWP/ + .\x64\ReleaseUWP/ + .\x64\ReleaseUWP/ + + + ..\..\bin64uwp\icuuc.dll + .\..\..\lib64uwp\icuuc.pdb + ..\..\lib64uwp\icuuc.lib + vccorlib.lib;WindowsApp.lib;msvcrt.lib;%(AdditionalDependencies) + + + + + .\..\..\lib64uwp\icuucd.tlb + + + .\x64\DebugUWP/common.pch + .\x64\DebugUWP/ + .\x64\DebugUWP/ + .\x64\DebugUWP/ + + + ..\..\bin64uwp\icuucd.dll + .\..\..\lib64uwp\icuucd.pdb + ..\..\lib64uwp\icuucd.lib + vccorlibd.lib;WindowsApp.lib;msvcrtd.lib;%(AdditionalDependencies) + + + + + .\..\..\libARMuwp\icuuc.tlb + + + .\ARM\ReleaseUWP/common.pch + .\ARM\ReleaseUWP/ + .\ARM\ReleaseUWP/ + .\ARM\ReleaseUWP/ + + + ..\..\binARMuwp\icuuc.dll + .\..\..\libARMuwp\icuuc.pdb + ..\..\libARMuwp\icuuc.lib + vccorlib.lib;WindowsApp.lib;msvcrt.lib;%(AdditionalDependencies) + + + + + .\..\..\libARMuwp\icuucd.tlb + + + .\ARM\DebugUWP/common.pch + .\ARM\DebugUWP/ + .\ARM\DebugUWP/ + .\ARM\DebugUWP/ + + + ..\..\binARMuwp\icuucd.dll + .\..\..\libARMuwp\icuucd.pdb + ..\..\libARMuwp\icuucd.lib + vccorlibd.lib;WindowsApp.lib;msvcrtd.lib;%(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ..\i18n;%(AdditionalIncludeDirectories) + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + + + copy "%(FullPath)" ..\..\include\unicode + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + + + + + copy "%(FullPath)" ..\..\include\unicode + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + + + + + + + copy "%(FullPath)" ..\..\include\unicode + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + copy "%(FullPath)" ..\..\include\unicode + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + + + + + + + copy "%(FullPath)" ..\..\include\unicode + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + copy "%(FullPath)" ..\..\include\unicode + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + + + \ No newline at end of file diff --git a/icu4c/source/common/locmap.cpp b/icu4c/source/common/locmap.cpp index 1fde5fba17e..3ca00757628 100644 --- a/icu4c/source/common/locmap.cpp +++ b/icu4c/source/common/locmap.cpp @@ -30,6 +30,7 @@ #include "locmap.h" #include "cstring.h" #include "cmemory.h" +#include "unicode/uloc.h" #if U_PLATFORM == U_PF_WINDOWS && defined(_MSC_VER) && (_MSC_VER >= 1500) /* @@ -40,10 +41,7 @@ * We might need to #include some Windows header and test for some version macro from there. * Or call some Windows function and see what it returns. */ -#define USE_WINDOWS_LOCALE_API -#endif - -#ifdef USE_WINDOWS_LOCALE_API +#define USE_WINDOWS_LCID_MAPPING_API #include #include #endif @@ -53,8 +51,8 @@ * The mapping from Win32 locale ID numbers to POSIX locale strings should * be the faster one. * - * Many LCID values come from winnt.h - * Some also come from http://www.microsoft.com/globaldev/reference/lcid-all.mspx + * Windows LCIDs are defined at https://msdn.microsoft.com/en-us/library/cc233965.aspx + * [MS-LCID] Windows Language Code Identifier (LCID) Reference */ /* @@ -126,7 +124,9 @@ static const ILcidPosixElement locmap_ ## id [] = // Keep static locale variables inside the function so that // it can be created properly during static init. // -// Note: This table should be updated periodically. Check the National Lanaguage Support API Reference Website. +// Note: This table should be updated periodically. Check the [MS-LCID] Windows Language Code Identifier +// (LCID) Reference defined at https://msdn.microsoft.com/en-us/library/cc233965.aspx +// // Microsoft is moving away from LCID in favor of locale name as of Vista. This table needs to be // maintained for support of older Windows version. // Update: Windows 7 (091130) @@ -138,6 +138,10 @@ static const ILcidPosixElement locmap_ ## id [] = //////////////////////////////////////////// */ +// For Windows this table is be a list of exceptions rather than a complete list as +// LocaleNameToLCID and LCIDToLocaleName provide 90% of these. +#ifndef USE_WINDOWS_LCID_MAPPING_API + ILCID_POSIX_ELEMENT_ARRAY(0x0436, af, af_ZA) ILCID_POSIX_SUBTABLE(ar) { @@ -212,34 +216,46 @@ ILCID_POSIX_SUBTABLE(ca) { ILCID_POSIX_ELEMENT_ARRAY(0x0483, co, co_FR) ILCID_POSIX_ELEMENT_ARRAY(0x045c, chr,chr_US) +#endif /* !USE_WINDOWS_LCID_MAPPING_API */ +// ICU has chosen different names for these. ILCID_POSIX_SUBTABLE(ckb) { {0x92, "ckb"}, {0x7c92, "ckb_Arab"}, {0x0492, "ckb_Arab_IQ"} }; +#ifndef USE_WINDOWS_LCID_MAPPING_API /* Declared as cs_CZ to get around compiler errors on z/OS, which defines cs as a function */ ILCID_POSIX_ELEMENT_ARRAY(0x0405, cs, cs_CZ) ILCID_POSIX_ELEMENT_ARRAY(0x0452, cy, cy_GB) ILCID_POSIX_ELEMENT_ARRAY(0x0406, da, da_DK) +#endif + +// Windows doesn't know POSIX or BCP47 Unicode phonebook sort names ILCID_POSIX_SUBTABLE(de) { +#ifndef USE_WINDOWS_LCID_MAPPING_API {0x07, "de"}, {0x0c07, "de_AT"}, {0x0807, "de_CH"}, {0x0407, "de_DE"}, {0x1407, "de_LI"}, {0x1007, "de_LU"}, +#endif {0x10407,"de_DE@collation=phonebook"}, /*This is really de_DE_PHONEBOOK on Windows*/ {0x10407,"de@collation=phonebook"} /*This is really de_DE_PHONEBOOK on Windows*/ }; +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_ELEMENT_ARRAY(0x0465, dv, dv_MV) ILCID_POSIX_ELEMENT_ARRAY(0x0408, el, el_GR) +#endif +// Windows uses an empty string for 'invariant' ILCID_POSIX_SUBTABLE(en) { +#ifndef USE_WINDOWS_LCID_MAPPING_API {0x09, "en"}, {0x0c09, "en_AU"}, {0x2809, "en_BZ"}, @@ -256,23 +272,28 @@ ILCID_POSIX_SUBTABLE(en) { {0x4809, "en_SG"}, {0x2C09, "en_TT"}, {0x0409, "en_US"}, - {0x007f, "en_US_POSIX"}, /* duplicate for roundtripping */ - {0x2409, "en_VI"}, /* Virgin Islands AKA Caribbean Islands (en_CB). */ +#endif + {0x007f, "en_US_POSIX"}, /* duplicate for round-tripping */ +#ifndef USE_WINDOWS_LCID_MAPPING_API + {0x2409, "en_VI"}, /* Virgin Islands AKA Caribbean Islands (en_CB). On Windows8+ This is 0x1000 or dynamically assigned */ {0x1c09, "en_ZA"}, {0x3009, "en_ZW"}, {0x2409, "en_029"}, - {0x0409, "en_AS"}, /* Alias for en_US. Leave last. */ - {0x0409, "en_GU"}, /* Alias for en_US. Leave last. */ - {0x0409, "en_MH"}, /* Alias for en_US. Leave last. */ - {0x0409, "en_MP"}, /* Alias for en_US. Leave last. */ - {0x0409, "en_UM"} /* Alias for en_US. Leave last. */ +#endif + {0x0409, "en_AS"}, /* Alias for en_US. Leave last. On Windows8+ This is 0x1000 or dynamically assigned */ + {0x0409, "en_GU"}, /* Alias for en_US. Leave last. On Windows8+ This is 0x1000 or dynamically assigned */ + {0x0409, "en_MH"}, /* Alias for en_US. Leave last. On Windows8+ This is 0x1000 or dynamically assigned */ + {0x0409, "en_MP"}, /* Alias for en_US. Leave last. On Windows8+ This is 0x1000 or dynamically assigned */ + {0x0409, "en_UM"} /* Alias for en_US. Leave last. On Windows8+ This is 0x1000 or dynamically assigned */ }; ILCID_POSIX_SUBTABLE(en_US_POSIX) { {0x007f, "en_US_POSIX"} /* duplicate for roundtripping */ }; +// Windows doesn't know POSIX or BCP47 Unicode traditional sort names ILCID_POSIX_SUBTABLE(es) { +#ifndef USE_WINDOWS_LCID_MAPPING_API {0x0a, "es"}, {0x2c0a, "es_AR"}, {0x400a, "es_BO"}, @@ -296,20 +317,27 @@ ILCID_POSIX_SUBTABLE(es) { {0x380a, "es_UY"}, {0x200a, "es_VE"}, {0x580a, "es_419"}, +#endif {0x040a, "es_ES@collation=traditional"}, - {0x040a, "es@collation=traditional"} + {0x040a, "es@collation=traditional"} // Windows will treat this as es-ES@collation=traditional }; +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_ELEMENT_ARRAY(0x0425, et, et_EE) ILCID_POSIX_ELEMENT_ARRAY(0x042d, eu, eu_ES) +#endif /* ISO-639 doesn't distinguish between Persian and Dari.*/ ILCID_POSIX_SUBTABLE(fa) { +#ifndef USE_WINDOWS_LCID_MAPPING_API {0x29, "fa"}, {0x0429, "fa_IR"}, /* Persian/Farsi (Iran) */ +#endif {0x048c, "fa_AF"} /* Persian/Dari (Afghanistan) */ }; + +#ifndef USE_WINDOWS_LCID_MAPPING_API /* duplicate for roundtripping */ ILCID_POSIX_SUBTABLE(fa_AF) { {0x8c, "fa_AF"}, /* Persian/Dari (Afghanistan) */ @@ -430,8 +458,10 @@ ILCID_POSIX_SUBTABLE(iu) { {0x085d, "iu_Latn_CA"}, {0x7c5d, "iu_Latn"} }; +#endif ILCID_POSIX_ELEMENT_ARRAY(0x040d, iw, iw_IL) /*Left in for compatibility*/ +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_ELEMENT_ARRAY(0x0411, ja, ja_JP) ILCID_POSIX_ELEMENT_ARRAY(0x0437, ka, ka_GE) ILCID_POSIX_ELEMENT_ARRAY(0x043f, kk, kk_KZ) @@ -447,14 +477,20 @@ ILCID_POSIX_SUBTABLE(ko) { ILCID_POSIX_ELEMENT_ARRAY(0x0457, kok, kok_IN) ILCID_POSIX_ELEMENT_ARRAY(0x0471, kr, kr_NG) +#endif ILCID_POSIX_SUBTABLE(ks) { /* We could add PK and CN too */ +#ifndef USE_WINDOWS_LCID_MAPPING_API {0x60, "ks"}, +#endif {0x0860, "ks_IN"}, /* Documentation doesn't mention script */ +#ifndef USE_WINDOWS_LCID_MAPPING_API {0x0460, "ks_Arab_IN"}, {0x0860, "ks_Deva_IN"} +#endif }; +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_ELEMENT_ARRAY(0x0440, ky, ky_KG) /* Kyrgyz is spoken in Kyrgyzstan */ ILCID_POSIX_ELEMENT_ARRAY(0x0476, la, la_IT) /* TODO: Verify the country */ ILCID_POSIX_ELEMENT_ARRAY(0x046e, lb, lb_LU) @@ -499,10 +535,12 @@ ILCID_POSIX_SUBTABLE(nl) { {0x0813, "nl_BE"}, {0x0413, "nl_NL"} }; +#endif /* The "no" locale split into nb and nn. By default in ICU, "no" is nb.*/ +// TODO: Not all of these are needed on Windows, but I don't know how ICU treats preferred ones here. ILCID_POSIX_SUBTABLE(no) { - {0x14, "no"}, /* really nb_NO */ + {0x14, "no"}, /* really nb_NO - actually Windows differentiates between neutral (no region) and specific (with region) */ {0x7c14, "nb"}, /* really nb */ {0x0414, "nb_NO"}, /* really nb_NO. Keep first in the 414 list. */ {0x0414, "no_NO"}, /* really nb_NO */ @@ -511,6 +549,7 @@ ILCID_POSIX_SUBTABLE(no) { {0x0814, "no_NO_NY"}/* really nn_NO */ }; +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_ELEMENT_ARRAY(0x046c, nso,nso_ZA) /* TODO: Verify the ISO-639 code */ ILCID_POSIX_ELEMENT_ARRAY(0x0482, oc, oc_FR) @@ -553,6 +592,7 @@ ILCID_POSIX_SUBTABLE(qu) { {0x086b, "quz_EC"}, {0x0C6b, "quz_PE"} }; +#endif ILCID_POSIX_SUBTABLE(quc) { {0x93, "quc"}, @@ -583,6 +623,7 @@ ILCID_POSIX_SUBTABLE(qut) { {0x0486, "quc_Latn_GT"} }; +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_ELEMENT_ARRAY(0x0417, rm, rm_CH) ILCID_POSIX_SUBTABLE(ro) { @@ -590,11 +631,16 @@ ILCID_POSIX_SUBTABLE(ro) { {0x0418, "ro_RO"}, {0x0818, "ro_MD"} }; +#endif +// TODO: This is almost certainly 'wrong'. 0 in Windows is a synonym for LOCALE_USER_DEFAULT. +// More likely this is a similar concept to the Windows 0x7f Invariant locale "" +// (Except that it's not invariant in ICU) ILCID_POSIX_SUBTABLE(root) { {0x00, "root"} }; +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_SUBTABLE(ru) { {0x19, "ru"}, {0x0419, "ru_RU"}, @@ -604,6 +650,7 @@ ILCID_POSIX_SUBTABLE(ru) { ILCID_POSIX_ELEMENT_ARRAY(0x0487, rw, rw_RW) ILCID_POSIX_ELEMENT_ARRAY(0x044f, sa, sa_IN) ILCID_POSIX_ELEMENT_ARRAY(0x0485, sah,sah_RU) +#endif ILCID_POSIX_SUBTABLE(sd) { {0x59, "sd"}, @@ -612,6 +659,7 @@ ILCID_POSIX_SUBTABLE(sd) { {0x0859, "sd_PK"} }; +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_SUBTABLE(se) { {0x3b, "se"}, {0x0c3b, "se_FI"}, @@ -694,6 +742,7 @@ ILCID_POSIX_SUBTABLE(tzm) { {0x045f, "tzm_Arab_MA"}, {0x045f, "tmz"} }; +#endif ILCID_POSIX_SUBTABLE(ug) { {0x80, "ug"}, @@ -701,6 +750,7 @@ ILCID_POSIX_SUBTABLE(ug) { {0x0480, "ug_Arab_CN"} }; +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_ELEMENT_ARRAY(0x0422, uk, uk_UA) ILCID_POSIX_SUBTABLE(ur) { @@ -708,6 +758,7 @@ ILCID_POSIX_SUBTABLE(ur) { {0x0820, "ur_IN"}, {0x0420, "ur_PK"} }; +#endif ILCID_POSIX_SUBTABLE(uz) { {0x43, "uz"}, @@ -724,12 +775,16 @@ ILCID_POSIX_SUBTABLE(ve) { /* TODO: Verify the country */ {0x0433, "ven_ZA"} }; +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_ELEMENT_ARRAY(0x042a, vi, vi_VN) ILCID_POSIX_ELEMENT_ARRAY(0x0488, wo, wo_SN) ILCID_POSIX_ELEMENT_ARRAY(0x0434, xh, xh_ZA) ILCID_POSIX_ELEMENT_ARRAY(0x043d, yi, yi) ILCID_POSIX_ELEMENT_ARRAY(0x046a, yo, yo_NG) +#endif +// Windows & ICU tend to different names for some of these +// TODO: Windows probably does not need all of these entries, but I don't know how the precedence works. ILCID_POSIX_SUBTABLE(zh) { {0x0004, "zh_Hans"}, {0x7804, "zh"}, @@ -753,12 +808,16 @@ ILCID_POSIX_SUBTABLE(zh) { {0x20804,"zh_Hans@collation=stroke"}, {0x20804,"zh_Hans_CN@collation=stroke"}, {0x20804,"zh_CN@collation=stroke"} + // TODO: Alternate collations for other LCIDs are missing, eg: 0x50804 }; +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_ELEMENT_ARRAY(0x0435, zu, zu_ZA) +#endif /* This must be static and grouped by LCID. */ static const ILcidPosixMap gPosixIDmap[] = { +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_MAP(af), /* af Afrikaans 0x36 */ ILCID_POSIX_MAP(am), /* am Amharic 0x5e */ ILCID_POSIX_MAP(ar), /* ar Arabic 0x01 */ @@ -775,20 +834,28 @@ static const ILcidPosixMap gPosixIDmap[] = { ILCID_POSIX_MAP(br), /* br Breton 0x7e */ ILCID_POSIX_MAP(ca), /* ca Catalan 0x03 */ ILCID_POSIX_MAP(chr), /* chr Cherokee 0x5c */ +#endif ILCID_POSIX_MAP(ckb), /* ckb Sorani (Central Kurdish) 0x92 */ +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_MAP(co), /* co Corsican 0x83 */ ILCID_POSIX_MAP(cs), /* cs Czech 0x05 */ ILCID_POSIX_MAP(cy), /* cy Welsh 0x52 */ ILCID_POSIX_MAP(da), /* da Danish 0x06 */ +#endif ILCID_POSIX_MAP(de), /* de German 0x07 */ +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_MAP(dv), /* dv Divehi 0x65 */ ILCID_POSIX_MAP(el), /* el Greek 0x08 */ +#endif ILCID_POSIX_MAP(en), /* en English 0x09 */ ILCID_POSIX_MAP(en_US_POSIX), /* invariant 0x7f */ ILCID_POSIX_MAP(es), /* es Spanish 0x0a */ +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_MAP(et), /* et Estonian 0x25 */ ILCID_POSIX_MAP(eu), /* eu Basque 0x2d */ +#endif ILCID_POSIX_MAP(fa), /* fa Persian/Farsi 0x29 */ +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_MAP(fa_AF), /* fa Persian/Dari 0x8c */ ILCID_POSIX_MAP(ff), /* ff Fula 0x67 */ ILCID_POSIX_MAP(fi), /* fi Finnish 0x0b */ @@ -818,7 +885,9 @@ static const ILcidPosixMap gPosixIDmap[] = { ILCID_POSIX_MAP(is), /* is Icelandic 0x0f */ ILCID_POSIX_MAP(it), /* it Italian 0x10 */ ILCID_POSIX_MAP(iu), /* iu Inuktitut 0x5d */ +#endif ILCID_POSIX_MAP(iw), /* iw Hebrew 0x0d */ +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_MAP(ja), /* ja Japanese 0x11 */ ILCID_POSIX_MAP(ka), /* ka Georgian 0x37 */ ILCID_POSIX_MAP(kk), /* kk Kazakh 0x3f */ @@ -828,7 +897,9 @@ static const ILcidPosixMap gPosixIDmap[] = { ILCID_POSIX_MAP(ko), /* ko Korean 0x12 */ ILCID_POSIX_MAP(kok), /* kok Konkani 0x57 */ ILCID_POSIX_MAP(kr), /* kr Kanuri 0x71 */ +#endif ILCID_POSIX_MAP(ks), /* ks Kashmiri 0x60 */ +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_MAP(ky), /* ky Kyrgyz 0x40 */ ILCID_POSIX_MAP(lb), /* lb Luxembourgish 0x6e */ ILCID_POSIX_MAP(la), /* la Latin 0x76 */ @@ -849,7 +920,9 @@ static const ILcidPosixMap gPosixIDmap[] = { ILCID_POSIX_MAP(ne), /* ne Nepali 0x61 */ ILCID_POSIX_MAP(nl), /* nl Dutch 0x13 */ /* ILCID_POSIX_MAP(nn), // no Norwegian 0x14 */ +#endif ILCID_POSIX_MAP(no), /* * Norwegian 0x14 */ +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_MAP(nso), /* nso Sotho, Northern (Sepedi dialect) 0x6c */ ILCID_POSIX_MAP(oc), /* oc Occitan 0x82 */ ILCID_POSIX_MAP(om), /* om Oromo 0x72 */ @@ -860,16 +933,22 @@ static const ILcidPosixMap gPosixIDmap[] = { ILCID_POSIX_MAP(ps), /* ps Pashto 0x63 */ ILCID_POSIX_MAP(pt), /* pt Portuguese 0x16 */ ILCID_POSIX_MAP(qu), /* qu Quechua 0x6B */ +#endif ILCID_POSIX_MAP(quc), /* quc K'iche 0x93 */ ILCID_POSIX_MAP(qut), /* qut K'iche 0x86 */ +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_MAP(rm), /* rm Raeto-Romance/Romansh 0x17 */ ILCID_POSIX_MAP(ro), /* ro Romanian 0x18 */ +#endif ILCID_POSIX_MAP(root), /* root 0x00 */ +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_MAP(ru), /* ru Russian 0x19 */ ILCID_POSIX_MAP(rw), /* rw Kinyarwanda 0x87 */ ILCID_POSIX_MAP(sa), /* sa Sanskrit 0x4f */ ILCID_POSIX_MAP(sah), /* sah Yakut 0x85 */ +#endif ILCID_POSIX_MAP(sd), /* sd Sindhi 0x59 */ +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_MAP(se), /* se Sami 0x3b */ /* ILCID_POSIX_MAP(sh), // sh Serbo-Croatian 0x1a */ ILCID_POSIX_MAP(si), /* si Sinhalese 0x5b */ @@ -893,18 +972,25 @@ static const ILcidPosixMap gPosixIDmap[] = { ILCID_POSIX_MAP(ts), /* ts Tsonga 0x31 */ ILCID_POSIX_MAP(tt), /* tt Tatar 0x44 */ ILCID_POSIX_MAP(tzm), /* tzm Tamazight 0x5f */ +#endif ILCID_POSIX_MAP(ug), /* ug Uighur 0x80 */ +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_MAP(uk), /* uk Ukrainian 0x22 */ ILCID_POSIX_MAP(ur), /* ur Urdu 0x20 */ +#endif ILCID_POSIX_MAP(uz), /* uz Uzbek 0x43 */ ILCID_POSIX_MAP(ve), /* ve Venda 0x33 */ +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_MAP(vi), /* vi Vietnamese 0x2a */ ILCID_POSIX_MAP(wo), /* wo Wolof 0x88 */ ILCID_POSIX_MAP(xh), /* xh Xhosa 0x34 */ ILCID_POSIX_MAP(yi), /* yi Yiddish 0x3d */ ILCID_POSIX_MAP(yo), /* yo Yoruba 0x6a */ +#endif ILCID_POSIX_MAP(zh), /* zh Chinese 0x04 */ +#ifndef USE_WINDOWS_LCID_MAPPING_API ILCID_POSIX_MAP(zu), /* zu Zulu 0x35 */ +#endif }; static const uint32_t gLocaleCount = UPRV_LENGTHOF(gPosixIDmap); @@ -991,7 +1077,7 @@ getPosixID(const ILcidPosixMap *this_0, uint32_t hostID) // ///////////////////////////////////// */ -#ifdef USE_WINDOWS_LOCALE_API +#ifdef USE_WINDOWS_LCID_MAPPING_API /* * Various language tags needs to be changed: * quz -> qu @@ -1017,43 +1103,56 @@ uprv_convertToPosix(uint32_t hostid, char *posixID, int32_t posixIDCapacity, UEr UBool bLookup = TRUE; const char *pPosixID = NULL; -#ifdef USE_WINDOWS_LOCALE_API +#ifdef USE_WINDOWS_LCID_MAPPING_API // Note: Windows primary lang ID 0x92 in LCID is used for Central Kurdish and // GetLocaleInfo() maps such LCID to "ku". However, CLDR uses "ku" for // Northern Kurdish and "ckb" for Central Kurdish. For this reason, we cannot // use the Windows API to resolve locale ID for this specific case. if ((hostid & 0x3FF) != 0x92) { int32_t tmpLen = 0; - char locName[157]; /* ULOC_FULLNAME_CAPACITY */ + UChar windowsLocaleName[LOCALE_NAME_MAX_LENGTH]; // ULOC_FULLNAME_CAPACITY > LOCALE_NAME_MAX_LENGTH + char locName[LOCALE_NAME_MAX_LENGTH]; // ICU name can't be longer than Windows name - tmpLen = GetLocaleInfoA(hostid, LOCALE_SNAME, (LPSTR)locName, UPRV_LENGTHOF(locName)); + // Note: LOCALE_ALLOW_NEUTRAL_NAMES was enabled in Windows7+, prior versions did not handle neutral (no-region) locale names. + tmpLen = LCIDToLocaleName(hostid, (PWSTR)windowsLocaleName, UPRV_LENGTHOF(windowsLocaleName), LOCALE_ALLOW_NEUTRAL_NAMES); if (tmpLen > 1) { - /* Windows locale name may contain sorting variant, such as "es-ES_tradnl". - In such case, we need special mapping data found in the hardcoded table - in this source file. */ - char *p = uprv_strchr(locName, '_'); - if (p) { - /* Keep the base locale, without variant */ - *p = 0; - tmpLen = uprv_strlen(locName); - } - else { - /* No hardcoded table lookup necessary */ - bLookup = FALSE; - } - /* Change the tag separator from '-' to '_' */ - p = locName; - while (*p) { - if (*p == '-') { - *p = '_'; + int i = 0; + // Only need to look up in table if have _, eg for de-de_phoneb type alternate sort. + bLookup = FALSE; + for (i = 0; i < UPRV_LENGTHOF(locName); i++) + { + locName[i] = (char)(windowsLocaleName[i]); + + // Windows locale name may contain sorting variant, such as "es-ES_tradnl". + // In such cases, we need special mapping data found in the hardcoded table + // in this source file. + if (windowsLocaleName[i] == L'_') + { + // Keep the base locale, without variant + // TODO: Should these be mapped from _phoneb to @collation=phonebook, etc.? + locName[i] = '\0'; + tmpLen = i; + bLookup = TRUE; + break; + } + else if (windowsLocaleName[i] == L'-') + { + // Windows names use -, ICU uses _ + locName[i] = '_'; + } + else if (windowsLocaleName[i] == L'\0') + { + // No point in doing more work than necessary + break; } - p++; } + // TODO: Need to understand this better, why isn't it an alias? FIX_LANGUAGE_ID_TAG(locName, tmpLen); pPosixID = locName; } } -#endif +#endif // USE_WINDOWS_LCID_MAPPING_API + if (bLookup) { const char *pCandidate = NULL; langID = LANGUAGE_LCID(hostid); @@ -1101,15 +1200,101 @@ uprv_convertToPosix(uint32_t hostid, char *posixID, int32_t posixIDCapacity, UEr // POSIX --> LCID // This should only be called from uloc_getLCID. // The locale ID must be in canonical form. -// langID is separate so that this file doesn't depend on the uloc_* API. // ///////////////////////////////////// */ +U_CAPI uint32_t +uprv_convertToLCIDPlatform(const char* localeID) +{ + // The purpose of this function is to leverage native platform name->lcid + // conversion functionality when available. +#ifdef USE_WINDOWS_LCID_MAPPING_API + DWORD nameLCIDFlags = 0; + UErrorCode myStatus = U_ZERO_ERROR; + + // First check for a Windows name->LCID match, fall through to catch + // ICU special cases, but Windows may know it already. +#if LOCALE_ALLOW_NEUTRAL_NAMES + nameLCIDFlags = LOCALE_ALLOW_NEUTRAL_NAMES; +#endif /* LOCALE_ALLOW_NEUTRAL_NAMES */ + + int32_t len; + char collVal[ULOC_KEYWORDS_CAPACITY] = {}; + char baseName[ULOC_FULLNAME_CAPACITY] = {}; + const char * mylocaleID = localeID; + + // Check any for keywords. + if (uprv_strchr(localeID, '@')) + { + len = uloc_getKeywordValue(localeID, "collation", collVal, UPRV_LENGTHOF(collVal) - 1, &myStatus); + if (U_SUCCESS(myStatus) && len > 0) + { + // If it contains the keyword collation, return 0 so that the LCID lookup table will be used. + return 0; + } + else + { + // If the locale ID contains keywords other than collation, just use the base name. + len = uloc_getBaseName(localeID, baseName, UPRV_LENGTHOF(baseName) - 1, &myStatus); + + if (U_SUCCESS(myStatus) && len > 0) + { + baseName[len] = 0; + mylocaleID = baseName; + } + } + } + + char asciiBCP47Tag[LOCALE_NAME_MAX_LENGTH] = {}; + // this will change it from de_DE@collation=phonebook to de-DE-u-co-phonebk form + int32_t bcp47Len = uloc_toLanguageTag(mylocaleID, asciiBCP47Tag, UPRV_LENGTHOF(asciiBCP47Tag), FALSE, &myStatus); + + if (U_SUCCESS(myStatus)) + { + // Need it to be UTF-16, not 8-bit + wchar_t bcp47Tag[LOCALE_NAME_MAX_LENGTH] = {}; + int i; + for (i = 0; i < UPRV_LENGTHOF(bcp47Tag); i++) + { + if (asciiBCP47Tag[i] == '\0') + { + break; + } + else + { + // Copy the character + bcp47Tag[i] = static_cast(asciiBCP47Tag[i]); + } + } + + if (i < (UPRV_LENGTHOF(bcp47Tag) - 1)) + { + // Ensure it's null terminated + bcp47Tag[i] = L'\0'; + LCID lcid = LocaleNameToLCID(bcp47Tag, nameLCIDFlags); + if (lcid > 0) + { + // Found LCID from windows, return that one, unless its completely ambiguous + // LOCALE_USER_DEFAULT and transients are OK because they will round trip + // for this process. + if (lcid != LOCALE_CUSTOM_UNSPECIFIED) + { + return lcid; + } + } + } + } +#endif /* USE_WINDOWS_LCID_MAPPING_API */ + + // No found, or not implemented on platforms without native name->lcid conversion + return 0; +} U_CAPI uint32_t uprv_convertToLCID(const char *langID, const char* posixID, UErrorCode* status) { - + // This function does the table lookup when native platform name->lcid conversion isn't available, + // or for locales that don't follow patterns the platform expects. uint32_t low = 0; uint32_t high = gLocaleCount; uint32_t mid; @@ -1172,4 +1357,3 @@ uprv_convertToLCID(const char *langID, const char* posixID, UErrorCode* status) *status = U_ILLEGAL_ARGUMENT_ERROR; return 0; /* return international (root) */ } - diff --git a/icu4c/source/common/locmap.h b/icu4c/source/common/locmap.h index be486051c61..bef62956e64 100644 --- a/icu4c/source/common/locmap.h +++ b/icu4c/source/common/locmap.h @@ -32,7 +32,8 @@ U_CAPI int32_t uprv_convertToPosix(uint32_t hostid, char* posixID, int32_t posixIDCapacity, UErrorCode* status); -/* Don't call this function directly. Use uloc_getLCID instead. */ +/* Don't call these functions directly. Use uloc_getLCID instead. */ +U_CAPI uint32_t uprv_convertToLCIDPlatform(const char *localeID); // Leverage platform conversion if possible U_CAPI uint32_t uprv_convertToLCID(const char *langID, const char* posixID, UErrorCode* status); #endif /* LOCMAP_H */ diff --git a/icu4c/source/common/normlzr.cpp b/icu4c/source/common/normlzr.cpp index a1a4949d30a..607660c45f1 100644 --- a/icu4c/source/common/normlzr.cpp +++ b/icu4c/source/common/normlzr.cpp @@ -23,6 +23,12 @@ #include "normalizer2impl.h" #include "uprops.h" // for uniset_getUnicode32Instance() +#if defined(_ARM64_) && defined(move32) + // System can define move32 intrinsics, but the char iters define move32 method + // using same undef trick in headers, so undef here to re-enable the method. +#undef move32 +#endif + U_NAMESPACE_BEGIN UOBJECT_DEFINE_RTTI_IMPLEMENTATION(Normalizer) diff --git a/icu4c/source/common/putil.cpp b/icu4c/source/common/putil.cpp index 899e0edd4fc..70618751ab9 100644 --- a/icu4c/source/common/putil.cpp +++ b/icu4c/source/common/putil.cpp @@ -76,14 +76,29 @@ * Should Cygwin be included as well (U_PLATFORM_HAS_WIN32_API) * to use native APIs as much as possible? */ +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN +#endif # define VC_EXTRALEAN # define NOUSER # define NOSERVICE # define NOIME # define NOMCX # include +# include "unicode\uloc.h" +#if U_PLATFORM_HAS_WINUWP_API == 0 # include "wintz.h" +#else // U_PLATFORM_HAS_WINUWP_API +typedef PVOID LPMSG; // TODO: figure out how to get rid of this typedef +#include +#include +#include +#include + +using namespace ABI::Windows::Foundation; +using namespace Microsoft::WRL; +using namespace Microsoft::WRL::Wrappers; +#endif #elif U_PLATFORM == U_PF_OS400 # include # include /* error code structure */ @@ -1008,16 +1023,65 @@ uprv_tzname_clear_cache() #endif } +// With the Universal Windows Platform we can just ask Windows for the name +#if U_PLATFORM_HAS_WINUWP_API +U_CAPI const char* U_EXPORT2 +uprv_getWindowsTimeZone() +{ + // Get default Windows timezone. + ComPtr calendar; + HRESULT hr = RoActivateInstance( + HStringReference(RuntimeClass_Windows_Globalization_Calendar).Get(), + &calendar); + if (SUCCEEDED(hr)) + { + ComPtr timezone; + hr = calendar.As(&timezone); + if (SUCCEEDED(hr)) + { + HString timezoneString; + hr = timezone->GetTimeZone(timezoneString.GetAddressOf()); + if (SUCCEEDED(hr)) + { + int32_t length = wcslen(timezoneString.GetRawBuffer(NULL)); + char* asciiId = (char*)uprv_calloc(length + 1, sizeof(char)); + if (asciiId != nullptr) + { + u_UCharsToChars((UChar*)timezoneString.GetRawBuffer(NULL), asciiId, length); + return asciiId; + } + } + } + } + + // Failed + return nullptr; +} +#endif + U_CAPI const char* U_EXPORT2 uprv_tzname(int n) { const char *tzid = NULL; #if U_PLATFORM_USES_ONLY_WIN32_API +#if U_PLATFORM_HAS_WINUWP_API > 0 + tzid = uprv_getWindowsTimeZone(); +#else tzid = uprv_detectWindowsTimeZone(); +#endif if (tzid != NULL) { return tzid; } + +#ifndef U_TZNAME + // The return value is free'd in timezone.cpp on Windows because + // the other code path returns a pointer to a heap location. + // If we don't have a name already, then tzname wouldn't be any + // better, so just fall back. + return uprv_strdup("Etc/UTC"); +#endif // !U_TZNAME + #else /*#if U_PLATFORM_IS_DARWIN_BASED @@ -1162,7 +1226,8 @@ UInitOnce gTimeZoneFilesInitOnce = U_INITONCE_INITIALIZER; static CharString *gTimeZoneFilesDirectory = NULL; #if U_POSIX_LOCALE || U_PLATFORM_USES_ONLY_WIN32_API - static char *gCorrectedPOSIXLocale = NULL; /* Heap allocated */ + static char *gCorrectedPOSIXLocale = NULL; /* Sometimes heap allocated */ + static bool gCorrectedPOSIXLocaleHeapAllocated = false; #endif static UBool U_CALLCONV putil_cleanup(void) @@ -1183,9 +1248,10 @@ static UBool U_CALLCONV putil_cleanup(void) #endif #if U_POSIX_LOCALE || U_PLATFORM_USES_ONLY_WIN32_API - if (gCorrectedPOSIXLocale) { + if (gCorrectedPOSIXLocale && gCorrectedPOSIXLocaleHeapAllocated) { uprv_free(gCorrectedPOSIXLocale); gCorrectedPOSIXLocale = NULL; + gCorrectedPOSIXLocaleHeapAllocated = false; } #endif return TRUE; @@ -1297,7 +1363,9 @@ static void U_CALLCONV dataDirectoryInitFn() { */ # if !defined(ICU_NO_USER_DATA_OVERRIDE) && !UCONFIG_NO_FILE_IO /* First try to get the environment variable */ - path=getenv("ICU_DATA"); +# if U_PLATFORM_HAS_WINUWP_API == 0 // Windows UWP does not support getenv + path=getenv("ICU_DATA"); +# endif # endif /* ICU_DATA_DIR may be set as a compile option. @@ -1326,9 +1394,35 @@ static void U_CALLCONV dataDirectoryInitFn() { } #endif +#if defined(ICU_DATA_DIR_WINDOWS) && U_PLATFORM_HAS_WINUWP_API != 0 + // Use data from the %windir%\globalization\icu directory + // This is only available if ICU is built as a system component + char datadir_path_buffer[MAX_PATH]; + UINT length = GetWindowsDirectoryA(datadir_path_buffer, UPRV_LENGTHOF(datadir_path_buffer)); + if (length > 0 && length < (UPRV_LENGTHOF(datadir_path_buffer) - sizeof(ICU_DATA_DIR_WINDOWS) - 1)) + { + if (datadir_path_buffer[length - 1] != '\\') + { + datadir_path_buffer[length++] = '\\'; + datadir_path_buffer[length] = '\0'; + } + + if ((length + 1 + sizeof(ICU_DATA_DIR_WINDOWS)) < UPRV_LENGTHOF(datadir_path_buffer)) + { + uprv_strcat(datadir_path_buffer, ICU_DATA_DIR_WINDOWS); + path = datadir_path_buffer; + } + } +#endif + if(path==NULL) { /* It looks really bad, set it to something. */ +#if U_PLATFORM_HAS_WIN32_API + // Windows UWP will require icudtl.dat file in same directory as icuuc.dll + path = ".\\"; +#else path = ""; +#endif } u_setDataDirectory(path); @@ -1366,7 +1460,12 @@ static void U_CALLCONV TimeZoneDataDirInitFn(UErrorCode &status) { status = U_MEMORY_ALLOCATION_ERROR; return; } +#if U_PLATFORM_HAS_WINUWP_API == 0 const char *dir = getenv("ICU_TIMEZONE_FILES_DIR"); +#else + // TODO: UWP does not support alternate timezone data directories at this time + const char *dir = ""; +#endif // U_PLATFORM_HAS_WINUWP_API #if defined(U_TIMEZONE_FILES_DIR) if (dir == NULL) { dir = TO_STRING(U_TIMEZONE_FILES_DIR); @@ -1603,6 +1702,7 @@ The leftmost codepage (.xxx) wins. if (gCorrectedPOSIXLocale == NULL) { gCorrectedPOSIXLocale = correctedPOSIXLocale; + gCorrectedPOSIXLocaleHeapAllocated = true; ucln_common_registerCleanup(UCLN_COMMON_PUTIL, putil_cleanup); correctedPOSIXLocale = NULL; } @@ -1618,25 +1718,115 @@ The leftmost codepage (.xxx) wins. UErrorCode status = U_ZERO_ERROR; char *correctedPOSIXLocale = 0; + // If we have already figured this out just use the cached value if (gCorrectedPOSIXLocale != NULL) { return gCorrectedPOSIXLocale; } - LCID id = GetThreadLocale(); - correctedPOSIXLocale = static_cast(uprv_malloc(POSIX_LOCALE_CAPACITY + 1)); - if (correctedPOSIXLocale) { - int32_t posixLen = uprv_convertToPosix(id, correctedPOSIXLocale, POSIX_LOCALE_CAPACITY, &status); - if (U_SUCCESS(status)) { - *(correctedPOSIXLocale + posixLen) = 0; - gCorrectedPOSIXLocale = correctedPOSIXLocale; - ucln_common_registerCleanup(UCLN_COMMON_PUTIL, putil_cleanup); - } else { - uprv_free(correctedPOSIXLocale); + // No cached value, need to determine the current value + static WCHAR windowsLocale[LOCALE_NAME_MAX_LENGTH]; +#if U_PLATFORM_HAS_WINUWP_API == 0 + // If not a Universal Windows App, we'll need user default language. + // Vista and above should use Locale Names instead of LCIDs + int length = GetUserDefaultLocaleName(windowsLocale, UPRV_LENGTHOF(windowsLocale)); +#else + // In a UWP app, we want the top language that the application and user agreed upon + ComPtr> languageList; + + ComPtr applicationLanguagesStatics; + HRESULT hr = GetActivationFactory( + HStringReference(RuntimeClass_Windows_Globalization_ApplicationLanguages).Get(), + &applicationLanguagesStatics); + if (SUCCEEDED(hr)) + { + hr = applicationLanguagesStatics->get_Languages(&languageList); + } + + if (FAILED(hr)) + { + // If there is no application context, then use the top language from the user language profile + ComPtr globalizationPreferencesStatics; + hr = GetActivationFactory( + HStringReference(RuntimeClass_Windows_System_UserProfile_GlobalizationPreferences).Get(), + &globalizationPreferencesStatics); + if (SUCCEEDED(hr)) + { + hr = globalizationPreferencesStatics->get_Languages(&languageList); } } + // We have a list of languages, ICU knows one, so use the top one for our locale + HString topLanguage; + if (SUCCEEDED(hr)) + { + hr = languageList->GetAt(0, topLanguage.GetAddressOf()); + } + + if (FAILED(hr)) + { + // Unexpected, use en-US by default + if (gCorrectedPOSIXLocale == NULL) { + gCorrectedPOSIXLocale = "en_US"; + } + + return gCorrectedPOSIXLocale; + } + + // ResolveLocaleName will get a likely subtags form consistent with Windows behavior. + int length = ResolveLocaleName(topLanguage.GetRawBuffer(NULL), windowsLocale, UPRV_LENGTHOF(windowsLocale)); +#endif + // Now we should have a Windows locale name that needs converted to the POSIX style, + if (length > 0) + { + // First we need to go from UTF-16 to char (and also convert from _ to - while we're at it.) + char modifiedWindowsLocale[LOCALE_NAME_MAX_LENGTH]; + + int i; + for (i = 0; i < UPRV_LENGTHOF(modifiedWindowsLocale); i++) + { + if (windowsLocale[i] == '_') + { + modifiedWindowsLocale[i] = '-'; + } + else + { + modifiedWindowsLocale[i] = static_cast(windowsLocale[i]); + } + + if (modifiedWindowsLocale[i] == '\0') + { + break; + } + } + + if (i >= UPRV_LENGTHOF(modifiedWindowsLocale)) + { + // Ran out of room, can't really happen, maybe we'll be lucky about a matching + // locale when tags are dropped + modifiedWindowsLocale[UPRV_LENGTHOF(modifiedWindowsLocale) - 1] = '\0'; + } + + // Now normalize the resulting name + if (correctedPOSIXLocale) + { + int32_t posixLen = uloc_canonicalize(modifiedWindowsLocale, correctedPOSIXLocale, POSIX_LOCALE_CAPACITY, &status); + if (U_SUCCESS(status)) + { + *(correctedPOSIXLocale + posixLen) = 0; + gCorrectedPOSIXLocale = correctedPOSIXLocale; + gCorrectedPOSIXLocaleHeapAllocated = true; + ucln_common_registerCleanup(UCLN_COMMON_PUTIL, putil_cleanup); + } + else + { + uprv_free(correctedPOSIXLocale); + } + } + } + + // If unable to find a locale we can agree upon, use en-US by default if (gCorrectedPOSIXLocale == NULL) { - return "en_US"; + gCorrectedPOSIXLocale = "en_US"; } return gCorrectedPOSIXLocale; @@ -1923,8 +2113,34 @@ int_getDefaultCodepage() #elif U_PLATFORM_USES_ONLY_WIN32_API static char codepage[64]; - sprintf(codepage, "windows-%d", GetACP()); - return codepage; + DWORD codepageNumber = 0; + +#if U_PLATFORM_HAS_WINUWP_API > 0 + // UWP doesn't have a direct API to get the default ACP as Microsoft would rather + // have folks use Unicode than a "system" code page, however this is the same + // codepage as the system default locale codepage. (FWIW, the system locale is + // ONLY used for codepage, it should never be used for anything else) + GetLocaleInfoEx(LOCALE_NAME_SYSTEM_DEFAULT, LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER, + (LPWSTR)&codepageNumber, sizeof(codepageNumber) / sizeof(WCHAR)); +#else + // Win32 apps can call GetACP + codepageNumber = GetACP(); +#endif + // Special case for UTF-8 + if (codepageNumber == 65001) + { + return "UTF-8"; + } + // Windows codepages can look like windows-1252, so format the found number + // the numbers are eclectic, however all valid system code pages, besides UTF-8 + // are between 3 and 19999 + if (codepageNumber > 0 && codepageNumber < 20000) + { + sprintf(codepage, "windows-%ld", codepageNumber); + return codepage; + } + // If the codepage number call failed then return UTF-8 + return "UTF-8"; #elif U_POSIX_LOCALE static char codesetName[100]; diff --git a/icu4c/source/common/putilimp.h b/icu4c/source/common/putilimp.h index 243726ca4dd..86bf04365ce 100644 --- a/icu4c/source/common/putilimp.h +++ b/icu4c/source/common/putilimp.h @@ -106,7 +106,10 @@ typedef size_t uintptr_t; #ifdef U_TZSET /* Use the predefined value. */ #elif U_PLATFORM_USES_ONLY_WIN32_API + // UWP doesn't support tzset or environment variables for tz +#if U_PLATFORM_HAS_WINUWP_API == 0 # define U_TZSET _tzset +#endif #elif U_PLATFORM == U_PF_OS400 /* not defined */ #else @@ -141,7 +144,10 @@ typedef size_t uintptr_t; #ifdef U_TZNAME /* Use the predefined value. */ #elif U_PLATFORM_USES_ONLY_WIN32_API + /* not usable on all windows platforms */ +#if U_PLATFORM_HAS_WINUWP_API == 0 # define U_TZNAME _tzname +#endif #elif U_PLATFORM == U_PF_OS400 /* not defined */ #else diff --git a/icu4c/source/common/ucln_imp.h b/icu4c/source/common/ucln_imp.h index 0473aaa0f66..1bfcde0fb8e 100644 --- a/icu4c/source/common/ucln_imp.h +++ b/icu4c/source/common/ucln_imp.h @@ -121,7 +121,9 @@ U_CAPI void U_EXPORT2 UCLN_FINI () /* READ READ READ READ! Are you getting compilation errors from windows.h? Any source file which includes this (ucln_imp.h) header MUST be defined with language extensions ON. */ +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN +#endif # define VC_EXTRALEAN # define NOUSER # define NOSERVICE diff --git a/icu4c/source/common/udata.cpp b/icu4c/source/common/udata.cpp index d620623a37b..29074a64c45 100644 --- a/icu4c/source/common/udata.cpp +++ b/icu4c/source/common/udata.cpp @@ -110,8 +110,12 @@ static u_atomic_int32_t gHaveTriedToLoadCommonData = ATOMIC_INT32_T_INITIALIZER( static UHashtable *gCommonDataCache = NULL; /* Global hash table of opened ICU data files. */ static icu::UInitOnce gCommonDataCacheInitOnce = U_INITONCE_INITIALIZER; +#if U_PLATFORM_HAS_WINUWP_API == 0 static UDataFileAccess gDataFileAccess = UDATA_DEFAULT_ACCESS; // Access not synchronized. // Modifying is documented as thread-unsafe. +#else +static UDataFileAccess gDataFileAccess = UDATA_NO_FILES; // Windows UWP looks in one spot explicitly +#endif static UBool U_CALLCONV udata_cleanup(void) @@ -619,12 +623,14 @@ U_NAMESPACE_END /*----------------------------------------------------------------------* * * - * Add a static reference to the common data library * + * Add a static reference to the common data library * * Unless overridden by an explicit udata_setCommonData, this will be * * our common data. * * * *----------------------------------------------------------------------*/ +#if U_PLATFORM_HAS_WINUWP_API == 0 // Windows UWP Platform does not support dll icu data at this time extern "C" const DataHeader U_DATA_API U_ICUDATA_ENTRY_POINT; +#endif /* * This would be a good place for weak-linkage declarations of @@ -672,6 +678,7 @@ openCommonData(const char *path, /* Path from OpenChoice? */ if(gCommonICUDataArray[commonDataIndex] != NULL) { return gCommonICUDataArray[commonDataIndex]; } +#if U_PLATFORM_HAS_WINUWP_API == 0 // Windows UWP Platform does not support dll icu data at this time int32_t i; for(i = 0; i < commonDataIndex; ++i) { if(gCommonICUDataArray[i]->pHeader == &U_ICUDATA_ENTRY_POINT) { @@ -679,6 +686,7 @@ openCommonData(const char *path, /* Path from OpenChoice? */ return NULL; } } +#endif } /* Add the linked-in data to the list. */ @@ -694,11 +702,13 @@ openCommonData(const char *path, /* Path from OpenChoice? */ setCommonICUDataPointer(uprv_getICUData_conversion(), FALSE, pErrorCode); } */ +#if U_PLATFORM_HAS_WINUWP_API == 0 // Windows UWP Platform does not support dll icu data at this time setCommonICUDataPointer(&U_ICUDATA_ENTRY_POINT, FALSE, pErrorCode); { Mutex lock; return gCommonICUDataArray[commonDataIndex]; } +#endif } @@ -1245,9 +1255,14 @@ doOpenChoice(const char *path, const char *type, const char *name, fprintf(stderr, " tocEntryPath = %s\n", tocEntryName.data()); #endif +#if U_PLATFORM_HAS_WINUWP_API == 0 // Windows UWP Platform does not support dll icu data at this time if(path == NULL) { path = COMMON_DATA_NAME; /* "icudt26e" */ } +#else + // Windows UWP expects only a single data file. + path = COMMON_DATA_NAME; /* "icudt26e" */ +#endif /************************ Begin loop looking for ind. files ***************/ #ifdef UDATA_DEBUG diff --git a/icu4c/source/common/uloc.cpp b/icu4c/source/common/uloc.cpp index 647ac29f169..4d98def1977 100644 --- a/icu4c/source/common/uloc.cpp +++ b/icu4c/source/common/uloc.cpp @@ -2119,6 +2119,20 @@ uloc_getLCID(const char* localeID) { UErrorCode status = U_ZERO_ERROR; char langID[ULOC_FULLNAME_CAPACITY]; + uint32_t lcid = 0; + + /* Check for incomplete id. */ + if (!localeID || uprv_strlen(localeID) < 2) { + return 0; + } + + // Attempt platform lookup if available + lcid = uprv_convertToLCIDPlatform(localeID); + if (lcid > 0) + { + // Windows found an LCID, return that + return lcid; + } uloc_getLanguage(localeID, langID, sizeof(langID), &status); if (U_FAILURE(status)) { diff --git a/icu4c/source/common/uloc_tag.cpp b/icu4c/source/common/uloc_tag.cpp index d665cdd30b9..dcd72716539 100644 --- a/icu4c/source/common/uloc_tag.cpp +++ b/icu4c/source/common/uloc_tag.cpp @@ -923,7 +923,7 @@ _appendKeywordsToLanguageTag(const char* localeID, char* appendAt, int32_t capac char extBuf[ULOC_KEYWORD_AND_VALUES_CAPACITY]; char *pExtBuf = extBuf; int32_t extBufCapacity = sizeof(extBuf); - const char *bcpKey, *bcpValue; + const char *bcpKey=nullptr, *bcpValue=nullptr; UErrorCode tmpStatus = U_ZERO_ERROR; int32_t keylen; UBool isBcpUExt; diff --git a/icu4c/source/common/umapfile.cpp b/icu4c/source/common/umapfile.cpp index 4a9a5ade631..bfa9b1b7190 100644 --- a/icu4c/source/common/umapfile.cpp +++ b/icu4c/source/common/umapfile.cpp @@ -28,7 +28,9 @@ /* memory-mapping base definitions ------------------------------------------ */ #if MAP_IMPLEMENTATION==MAP_WIN32 +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN +#endif # define VC_EXTRALEAN # define NOUSER # define NOSERVICE @@ -107,17 +109,42 @@ UDataMemory_init(pData); /* Clear the output struct. */ /* open the input file */ +#if U_PLATFORM_HAS_WINUWP_API == 0 file=CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_RANDOM_ACCESS, NULL); +#else + // First we need to go from char to UTF-16 + // u_UCharsToChars could work but it requires length. + WCHAR utf16Path[MAX_PATH]; + int i; + for (i = 0; i < UPRV_LENGTHOF(utf16Path); i++) + { + utf16Path[i] = path[i]; + if (path[i] == '\0') + { + break; + } + } + if (i >= UPRV_LENGTHOF(utf16Path)) + { + // Ran out of room, unlikely but be safe + utf16Path[UPRV_LENGTHOF(utf16Path) - 1] = '\0'; + } + + // TODO: Is it worth setting extended parameters to specify random access? + file = CreateFile2(utf16Path, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, NULL); +#endif if(file==INVALID_HANDLE_VALUE) { return FALSE; } /* Declare and initialize a security descriptor. This is required for multiuser systems on Windows 2000 SP4 and beyond */ + // TODO: UWP does not have this function and I do not think it is required? +#if U_PLATFORM_HAS_WINUWP_API == 0 if (InitializeSecurityDescriptor(&securityDesc, SECURITY_DESCRIPTOR_REVISION)) { - /* give the security descriptor a Null Dacl done using the "TRUE, (PACL)NULL" here */ + /* give the security descriptor a Null Dacl done using the "TRUE, (PACL)NULL" here */ if (SetSecurityDescriptorDacl(&securityDesc, TRUE, (PACL)NULL, FALSE)) { /* Make the security attributes point to the security descriptor */ uprv_memset(&mappingAttributes, 0, sizeof(mappingAttributes)); @@ -132,6 +159,9 @@ /* create an unnamed Windows file-mapping object for the specified file */ map=CreateFileMapping(file, mappingAttributesPtr, PAGE_READONLY, 0, 0, NULL); +#else + map = CreateFileMappingFromApp(file, NULL, PAGE_READONLY, 0, NULL); +#endif CloseHandle(file); if(map==NULL) { return FALSE; diff --git a/icu4c/source/common/umutex.h b/icu4c/source/common/umutex.h index d29e88f2786..8e1f6e934a4 100644 --- a/icu4c/source/common/umutex.h +++ b/icu4c/source/common/umutex.h @@ -86,7 +86,9 @@ U_NAMESPACE_END // Original plan was to use gcc atomics for MinGW, but they // aren't supported, so we fold MinGW into this path. +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN +#endif # define VC_EXTRALEAN # define NOUSER # define NOSERVICE @@ -331,7 +333,9 @@ U_NAMESPACE_END * win32 APIs for Critical Sections. */ +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN +#endif # define VC_EXTRALEAN # define NOUSER # define NOSERVICE diff --git a/icu4c/source/common/unicode/chariter.h b/icu4c/source/common/unicode/chariter.h index 76f01402e7b..7a4e1a2f487 100644 --- a/icu4c/source/common/unicode/chariter.h +++ b/icu4c/source/common/unicode/chariter.h @@ -607,6 +607,10 @@ public: * @return the new position * @stable ICU 2.0 */ +#ifdef move32 + // One of the system headers right now is sometimes defining a conflicting macro we don't use +#undef move32 +#endif virtual int32_t move32(int32_t delta, EOrigin origin) = 0; /** diff --git a/icu4c/source/common/unicode/platform.h b/icu4c/source/common/unicode/platform.h index 41b363093cc..3eefe8d47ad 100644 --- a/icu4c/source/common/unicode/platform.h +++ b/icu4c/source/common/unicode/platform.h @@ -233,6 +233,18 @@ # define U_PLATFORM_HAS_WIN32_API 0 #endif +/** + * \def U_PLATFORM_HAS_WINUWP_API + * Defines whether target is intended for Universal Windows Platform API + * Set to 1 for Windows10 Release Solution Configuration + * @internal + */ +#ifdef U_PLATFORM_HAS_WINUWP_API + /* Use the predefined value. */ +#else +# define U_PLATFORM_HAS_WINUWP_API 0 +#endif + /** * \def U_PLATFORM_IMPLEMENTS_POSIX * Defines whether the platform implements (most of) the POSIX API. diff --git a/icu4c/source/common/unicode/uchriter.h b/icu4c/source/common/unicode/uchriter.h index 21c93154141..efcd263f8bc 100644 --- a/icu4c/source/common/unicode/uchriter.h +++ b/icu4c/source/common/unicode/uchriter.h @@ -334,6 +334,10 @@ public: * @return the new position * @stable ICU 2.0 */ +#ifdef move32 + // One of the system headers right now is sometimes defining a conflicting macro we don't use +#undef move32 +#endif virtual int32_t move32(int32_t delta, EOrigin origin); /** diff --git a/icu4c/source/common/unicode/uloc.h b/icu4c/source/common/unicode/uloc.h index c0a53daa255..f330aa4d56c 100644 --- a/icu4c/source/common/unicode/uloc.h +++ b/icu4c/source/common/unicode/uloc.h @@ -539,6 +539,9 @@ uloc_getISO3Country(const char* localeID); * Gets the Win32 LCID value for the specified locale. * If the ICU locale is not recognized by Windows, 0 will be returned. * + * LCIDs were deprecated with Windows Vista and Microsoft recommends + * that developers use BCP47 style tags instead (uloc_toLanguageTag). + * * @param localeID the locale to get the Win32 LCID value with * @return country the Win32 LCID for localeID * @stable ICU 2.0 diff --git a/icu4c/source/common/unicode/uvernum.h b/icu4c/source/common/unicode/uvernum.h index 4479ea9ff1c..cae59ad880c 100644 --- a/icu4c/source/common/unicode/uvernum.h +++ b/icu4c/source/common/unicode/uvernum.h @@ -125,7 +125,12 @@ * This value will change in the subsequent releases of ICU * @stable ICU 2.6 */ +#if U_PLATFORM_HAS_WINUWP_API == 0 #define U_ICU_VERSION_SHORT "59" +#else +// U_DISABLE_RENAMING does not impact dat file name +#define U_ICU_VERSION_SHORT +#endif /* U_PLATFORM_HAS_WINUWP_API == 0 */ #ifndef U_HIDE_INTERNAL_API /** Data version in ICU4C. diff --git a/icu4c/source/common/wintz.cpp b/icu4c/source/common/wintz.cpp index 397e430f730..34276eb7388 100644 --- a/icu4c/source/common/wintz.cpp +++ b/icu4c/source/common/wintz.cpp @@ -14,7 +14,8 @@ #include "unicode/utypes.h" // This file contains only desktop Windows behavior -#if U_PLATFORM_HAS_WIN32_API +// Windows UWP calls Windows::Globalization directly, so this isn't needed there. +#if U_PLATFORM_HAS_WIN32_API && (U_PLATFORM_HAS_WINUWP_API == 0) #include "wintz.h" #include "cmemory.h" @@ -23,7 +24,9 @@ #include "unicode/ures.h" #include "unicode/ustring.h" +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN +#endif # define VC_EXTRALEAN # define NOUSER # define NOSERVICE @@ -378,4 +381,4 @@ uprv_detectWindowsTimeZone() return icuid; } -#endif /* U_PLATFORM_HAS_WIN32_API */ +#endif /* U_PLATFORM_HAS_WIN32_API && (U_PLATFORM_HAS_WINUWP_API == 0) */ diff --git a/icu4c/source/common/wintz.h b/icu4c/source/common/wintz.h index 242e7d95e79..69da7f397c3 100644 --- a/icu4c/source/common/wintz.h +++ b/icu4c/source/common/wintz.h @@ -16,7 +16,9 @@ #include "unicode/utypes.h" -#if U_PLATFORM_HAS_WIN32_API +// This file contains only desktop windows behavior +// Windows UWP calls Windows::Globalization directly, so this isn't needed there. +#if U_PLATFORM_HAS_WIN32_API && (U_PLATFORM_HAS_WINUWP_API == 0) /** * \file @@ -31,6 +33,6 @@ U_CDECL_END U_CFUNC const char* U_EXPORT2 uprv_detectWindowsTimeZone(); -#endif /* U_PLATFORM_HAS_WIN32_API */ +#endif /* U_PLATFORM_HAS_WIN32_API && (U_PLATFORM_HAS_WINUWP_API == 0) */ #endif /* __WINTZ */ diff --git a/icu4c/source/data/makedata.mak b/icu4c/source/data/makedata.mak index f22918e97c0..65c2e76cf85 100644 --- a/icu4c/source/data/makedata.mak +++ b/icu4c/source/data/makedata.mak @@ -14,6 +14,9 @@ # Keep the following in sync with the version - see common/unicode/uvernum.h U_ICUDATA_NAME=icudt59 ############################################################################## +!IF "$(UWP)" == "UWP" +U_ICUDATA_NAME=icudt +!ENDIF U_ICUDATA_ENDIAN_SUFFIX=l UNICODE_VERSION=9.0 ICU_LIB_TARGET=$(DLL_OUTPUT)\$(U_ICUDATA_NAME).dll @@ -119,10 +122,14 @@ ICUDATA=$(ICUP)\source\data # This is the same place that all of the other ICU DLLs go (the code-containing DLLs) # The lib file for the data DLL goes in $(DLL_OUTPUT)/../lib/ # -!IF "$(CFG)" == "x64\Release" || "$(CFG)" == "x64\Debug" -DLL_OUTPUT=$(ICUP)\bin64 +!IF "$(CFG)" == "ARM\Release" || "$(CFG)" == "ARM\Debug" +DLL_OUTPUT=$(ICUP)\binARM$(UWP) +!ELSE IF "$(CFG)" == "x64\Release" || "$(CFG)" == "x64\Debug" +DLL_OUTPUT=$(ICUP)\bin64$(UWP) +!ELSE IF "$(UWP)" == "UWP" +DLL_OUTPUT=$(ICUP)\bin32$(UWP) !ELSE -DLL_OUTPUT=$(ICUP)\bin +DLL_OUTPUT=$(ICUP)\bin$(UWP) !ENDIF # @@ -147,14 +154,28 @@ TESTDATABLD=$(ICUP)\source\test\testdata\out\build # Directory under which all of the ICU data building tools live. # ICUTOOLS=$(ICUP)\source\tools +!MESSAGE ICU tools path is $(ICUTOOLS) + +# +# TOOLS CFG PATH +# ARM needs to use one of the other tools, so make sure to get an usable cfg path +# Since tools, particularly pkggen, have architecture built-in, we made x64 on +# Windows be machine-independent and use those tools. +# +CFGTOOLS=$(CFG) +!IF "$(CFG)" == "ARM\Release" || "$(CFG)" == "ARM\Debug" +CFGTOOLS=x64\Release +!ENDIF +!MESSAGE ICU tools CFG subpath is $(CFGTOOLS) # The current ICU tools need to be in the path first. -!IF "$(CFG)" == "x64\Release" || "$(CFG)" == "x64\Debug" -PATH = $(ICUP)\bin64;$(PATH) -ICUPBIN=$(ICUP)\bin64 -!ELSE +# x86 uses x86, x64 and arm use x64 +!IF "$(CFG)" == "x86\Release" || "$(CFG)" == "x86\Debug" PATH = $(ICUP)\bin;$(PATH) ICUPBIN=$(ICUP)\bin +!ELSE +PATH = $(ICUP)\bin64;$(PATH) +ICUPBIN=$(ICUP)\bin64 !ENDIF @@ -492,6 +513,12 @@ SPREP_FILES = $(SPREP_SOURCE:.txt=.spp) # Common defines for both ways of building ICU's data library. COMMON_ICUDATA_DEPENDENCIES="$(ICUPBIN)\pkgdata.exe" "$(ICUTMP)\icudata.res" "$(ICUP)\source\stubdata\stubdatabuilt.txt" COMMON_ICUDATA_ARGUMENTS=-f -e $(U_ICUDATA_NAME) -v $(ICU_PACKAGE_MODE) -c -p $(ICUPKG) -T "$(ICUTMP)" -L $(U_ICUDATA_NAME) -d "$(ICUBLD_PKG)" -s . +!IF "$(UWP)" == "UWP" +COMMON_ICUDATA_ARGUMENTS=$(COMMON_ICUDATA_ARGUMENTS) -u +!IF "$(CFG)" == "ARM\Release" || "$(CFG)" == "ARM\Debug" +COMMON_ICUDATA_ARGUMENTS=$(COMMON_ICUDATA_ARGUMENTS) -a +!ENDIF +!ENDIF ############################################################################# # @@ -505,6 +532,11 @@ COMMON_ICUDATA_ARGUMENTS=-f -e $(U_ICUDATA_NAME) -v $(ICU_PACKAGE_MODE) -c -p $( ALL : GODATA "$(ICU_LIB_TARGET)" "$(TESTDATAOUT)\testdata.dat" @echo All targets are up to date +!IF "$(UWP)" == "UWP" + @if not exist "$(ICUMAKE)\..\..\commondata\" mkdir "$(ICUMAKE)\..\..\commondata\" + copy "$(ICUOUT)\$(U_ICUDATA_NAME)$(U_ICUDATA_ENDIAN_SUFFIX).dat" "$(ICUMAKE)\..\..\commondata\" +!ENDIF + # The core Unicode properties files (uprops.icu, ucase.icu, ubidi.icu) # are hardcoded in the common DLL and therefore not included in the data package any more. # They are not built by default but need to be built for ICU4J data and for getting the .c source files @@ -556,9 +588,9 @@ DEBUGUTILITIESDATA_DIR=main\tests\core\src\com\ibm\icu\dev\test\util DEBUGUTILITIESDATA_SRC=DebugUtilitiesData.java # Build DebugUtilitiesData.java -"$(ICUOUT)\icu4j\src\$(DEBUGUTILITIESDATA_DIR)\$(DEBUGUTILITIESDATA_SRC)" : {"$(ICUTOOLS)\gentest\$(CFG)"}gentest.exe +"$(ICUOUT)\icu4j\src\$(DEBUGUTILITIESDATA_DIR)\$(DEBUGUTILITIESDATA_SRC)" : {"$(ICUTOOLS)\gentest\$(CFGTOOLS)"}gentest.exe if not exist "$(ICUOUT)\icu4j\src\$(DEBUGUTILITIESDATA_DIR)" mkdir "$(ICUOUT)\icu4j\src\$(DEBUGUTILITIESDATA_DIR)" - "$(ICUTOOLS)\gentest\$(CFG)\gentest" -j -d"$(ICUOUT)\icu4j\src\$(DEBUGUTILITIESDATA_DIR)" + "$(ICUTOOLS)\gentest\$(CFGTOOLS)\gentest" -j -d"$(ICUOUT)\icu4j\src\$(DEBUGUTILITIESDATA_DIR)" ICU4J_DATA="$(ICUOUT)\icu4j\icudata.jar" "$(ICUOUT)\icu4j\testdata.jar" "$(ICUOUT)\icu4j\src\$(DEBUGUTILITIESDATA_DIR)\$(DEBUGUTILITIESDATA_SRC)" @@ -602,10 +634,10 @@ icu4j-data-install : # # testdata - nmake will invoke pkgdata, which will create testdata.dat # -"$(TESTDATAOUT)\testdata.dat": "$(TESTDATA)\*" "$(ICUBLD_PKG)\$(ICUCOL)\ucadata.icu" $(TRANSLIT_RES_FILES) $(MISC_FILES) $(RB_FILES) {"$(ICUTOOLS)\genrb\$(CFG)"}genrb.exe +"$(TESTDATAOUT)\testdata.dat": "$(TESTDATA)\*" "$(ICUBLD_PKG)\$(ICUCOL)\ucadata.icu" $(TRANSLIT_RES_FILES) $(MISC_FILES) $(RB_FILES) {"$(ICUTOOLS)\genrb\$(CFGTOOLS)"}genrb.exe @cd "$(TESTDATA)" @echo building testdata... - nmake /nologo /f "$(TESTDATA)\testdata.mak" TESTDATA=. ICUTOOLS="$(ICUTOOLS)" ICUPBIN="$(ICUPBIN)" ICUP="$(ICUP)" CFG=$(CFG) TESTDATAOUT="$(TESTDATAOUT)" TESTDATABLD="$(TESTDATABLD)" + nmake /nologo /f "$(TESTDATA)\testdata.mak" TESTDATA=. ICUTOOLS="$(ICUTOOLS)" ICUPBIN="$(ICUPBIN)" ICUP="$(ICUP)" CFG=$(CFGTOOLS) TESTDATAOUT="$(TESTDATAOUT)" TESTDATABLD="$(TESTDATABLD)" #invoke pkgdata for ICU common data # pkgdata will drop all output files (.dat, .dll, .lib) into the target (ICUBLD_PKG) directory. @@ -669,6 +701,7 @@ $(SPREP_FILES:.spp=.spp ) < <_ProjectFileVersion>10.0.30319.1 - .\x86\Release\ - .\x86\Release\ + .\data\tmp\x86\ + .\data\build\ NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Release NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Release clean all NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Release clean @@ -47,8 +47,8 @@ $(NMakeForcedIncludes) $(NMakeAssemblySearchPath) $(NMakeForcedUsingAssemblies) - .\x86\Debug\ - .\x86\Debug\ + .\data\tmp\x86\ + .\data\build\ NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Debug NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Debug clean all NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Debug clean @@ -58,8 +58,8 @@ $(NMakeForcedIncludes) $(NMakeAssemblySearchPath) $(NMakeForcedUsingAssemblies) - .\x64\Release\ - .\x64\Release\ + .\data\tmp\x64\ + .\data\build\ NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Release NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Release clean all NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Release clean @@ -69,8 +69,8 @@ $(NMakeForcedIncludes) $(NMakeAssemblySearchPath) $(NMakeForcedUsingAssemblies) - .\x64\Debug\ - .\x64\Debug\ + .\data\tmp\x64\ + .\data\build\ NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Debug NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Debug clean all NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Debug clean @@ -216,4 +216,4 @@ - + \ No newline at end of file diff --git a/icu4c/source/data/makedata_uwp.vcxproj b/icu4c/source/data/makedata_uwp.vcxproj new file mode 100644 index 00000000000..68e24c5abd9 --- /dev/null +++ b/icu4c/source/data/makedata_uwp.vcxproj @@ -0,0 +1,137 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Debug + ARM + + + Release + Win32 + + + Release + x64 + + + Release + ARM + + + + {B1D53358-37BD-48BC-B27C-68BAF1E78508} + MakeFileProj + en-US + 14.0 + true + Windows Store + 10.0.10586.0 + 10.0.10240.0 + 10.0 + Makefile + false + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + .\data\tmp\x86\ + .\data\tmp\x86\ + .\data\tmp\x64\ + .\data\tmp\x64\ + .\data\tmp\arm\ + .\data\tmp\arm\ + .\data\build\ + .\data\build\ + .\data\build\ + .\data\build\ + .\data\build\ + .\data\build\ + NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Release UWP=UWP + NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Release UWP=UWP clean all + NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Release UWP=UWP clean + NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Debug UWP=UWP + NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Debug UWP=UWP clean all + NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Debug UWP=UWP clean + NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Release UWP=UWP + NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Release UWP=UWP clean all + NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Release UWP=UWP clean + NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Debug UWP=UWP + NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Debug UWP=UWP clean all + NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Debug UWP=UWP clean + NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=ARM\Release UWP=UWP + NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=ARM\Release UWP=UWP clean all + NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=ARM\Release UWP=UWP clean + NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=ARM\Debug UWP=UWP + NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=ARM\Debug UWP=UWP clean all + NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=ARM\Debug UWP=UWP clean + + + + .\out\tmp\x86\ReleaseUWPBuildLog.html + + + + + .\out\tmp\x86\DebugUWPBuildLog.html + + + + + .\out\tmp\x64\ReleaseUWPBuildLog.html + + + + + .\out\tmp\x64\DebugUWPBuildLog.html + + + + + .\out\tmp\arm\ReleaseUWPBuildLog.html + + + + + .\out\tmp\arm\DebugUWPBuildLog.html + + + + + + + + + + + + + + + + + + + {D9DF7F2F-93B7-4810-B5CD-96F4F33C079B} + false + + + + + + \ No newline at end of file diff --git a/icu4c/source/i18n/i18n_uwp.vcxproj b/icu4c/source/i18n/i18n_uwp.vcxproj new file mode 100644 index 00000000000..60bfd938658 --- /dev/null +++ b/icu4c/source/i18n/i18n_uwp.vcxproj @@ -0,0 +1,1020 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Debug + ARM + + + Release + Win32 + + + Release + x64 + + + Release + ARM + + + + {6786C051-383B-47E0-9E82-B8B994E06A25} + DynamicLibrary + en-US + 14.0 + true + Windows Store + 10.0.10586.0 + 10.0.10240.0 + 10.0 + + + + DynamicLibrary + false + MultiByte + v140 + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + .\x86\ReleaseUWP\ + .\x86\ReleaseUWP\ + .\x86\DebugUWP\ + .\x86\DebugUWP\ + .\x64\ReleaseUWP\ + .\x64\ReleaseUWP\ + .\x64\DebugUWP\ + .\x64\DebugUWP\ + .\arm\ReleaseUWP\ + .\arm\ReleaseUWP\ + .\arm\DebugUWP\ + .\arm\DebugUWP\ + false + true + + + + U_DISABLE_RENAMING=1;U_PLATFORM_HAS_WINUWP_API=1;%(PreprocessorDefinitions) + true + true + + + ..\..\include;..\common;%(AdditionalIncludeDirectories) + + U_DISABLE_RENAMING=1;U_PLATFORM_HAS_WINUWP_API=1;U_ATTRIBUTE_DEPRECATED=;_CRT_SECURE_NO_DEPRECATE;U_I18N_IMPLEMENTATION;U_PLATFORM_USES_ONLY_WIN32_API=1;%(PreprocessorDefinitions) + true + + + true + false + true + Level3 + true + Default + NotUsing + false + /utf-8 %(AdditionalOptions) + + + U_DISABLE_RENAMING=1;U_PLATFORM_HAS_WINUWP_API=1;%(PreprocessorDefinitions) + 0x0409 + ../common;%(AdditionalIncludeDirectories) + + + true + false + true + + + true + + + + + NDEBUG;%(PreprocessorDefinitions) + + + NDEBUG;%(PreprocessorDefinitions) + MultiThreadedDLL + + + NDEBUG;%(PreprocessorDefinitions) + + + true + + + + + _DEBUG;%(PreprocessorDefinitions) + + + _DEBUG;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Disabled + EnableFastChecks + true + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + + + + + Win32 + + + WIN32;%(PreprocessorDefinitions) + + + + + X64 + + + WIN64;WIN32;%(PreprocessorDefinitions) + + + MachineX64 + + + + + ARM + + + ARM;WIN32;%(PreprocessorDefinitions) + + + MachineARM + + + + + .\..\..\lib32uwp\icuin.tlb + + + .\x86\ReleaseUWP/i18n.pch + .\x86\ReleaseUWP/ + .\x86\ReleaseUWP/ + .\x86\ReleaseUWP/ + + + ..\..\bin32uwp\icuin.dll + .\..\..\lib32uwp\icuin.pdb + ..\..\lib32uwp\icuin.lib + ..\..\lib32uwp\icuuc.lib;%(AdditionalDependencies) + + + + + .\..\..\lib32uwp\icuind.tlb + + + .\x86\DebugUWP/i18n.pch + .\x86\DebugUWP/ + .\x86\DebugUWP/ + .\x86\DebugUWP/ + + + ..\..\bin32uwp\icuind.dll + .\..\..\lib32uwp\icuind.pdb + ..\..\lib32uwp\icuind.lib + ..\..\lib32uwp\icuucd.lib;%(AdditionalDependencies) + + + + + .\..\..\lib64uwp\icuin.tlb + + + .\x64\ReleaseUWP/i18n.pch + .\x64\ReleaseUWP/ + .\x64\ReleaseUWP/ + .\x64\ReleaseUWP/ + + + ..\..\bin64uwp\icuin.dll + .\..\..\lib64uwp\icuin.pdb + ..\..\lib64uwp\icuin.lib + ..\..\lib64uwp\icuuc.lib;%(AdditionalDependencies) + + + + + .\..\..\lib64uwp\icuind.tlb + + + .\x64\DebugUWP/i18n.pch + .\x64\DebugUWP/ + .\x64\DebugUWP/ + .\x64\DebugUWP/ + + + ..\..\bin64uwp\icuind.dll + .\..\..\lib64uwp\icuind.pdb + ..\..\lib64uwp\icuind.lib + ..\..\lib64uwp\icuucd.lib;%(AdditionalDependencies) + + + + + .\..\..\libARMuwp\icuin.tlb + + + .\ARM\ReleaseUWP/i18n.pch + .\ARM\ReleaseUWP/ + .\ARM\ReleaseUWP/ + .\ARM\ReleaseUWP/ + + + ..\..\binARMuwp\icuin.dll + .\..\..\libARMuwp\icuin.pdb + ..\..\libARMuwp\icuin.lib + ..\..\libARMuwp\icuuc.lib;%(AdditionalDependencies) + + + + + .\..\..\libARMuwp\icuind.tlb + + + .\ARM\DebugUWP/i18n.pch + .\ARM\DebugUWP/ + .\ARM\DebugUWP/ + .\ARM\DebugUWP/ + + + ..\..\binARMuwp\icuind.dll + .\..\..\libARMuwp\icuind.pdb + ..\..\libARMuwp\icuind.lib + ..\..\libARMuwp\icuucd.lib;%(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + false + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + + + + + + + + + + + + + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + + + + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + copy "%(FullPath)" ..\..\include\unicode + + ..\..\include\unicode\%(Filename)%(Extension);%(Outputs) + + + + + + + + + + + {C10CF34B-3F79-430E-AD38-5A32DC0589C2} + false + + + + + + \ No newline at end of file diff --git a/icu4c/source/i18n/windtfmt.cpp b/icu4c/source/i18n/windtfmt.cpp index 4afb2032cbe..f9b575f8ab0 100644 --- a/icu4c/source/i18n/windtfmt.cpp +++ b/icu4c/source/i18n/windtfmt.cpp @@ -35,7 +35,9 @@ #include "windtfmt.h" #include "wintzimpl.h" +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN +#endif # define VC_EXTRALEAN # define NOUSER # define NOSERVICE @@ -92,12 +94,83 @@ UnicodeString* Win32DateFormat::getTimeDateFormat(const Calendar *cal, const Loc return result; } +// TODO: This is copied in both winnmfmt.cpp and windtfmt.cpp, but really should +// be factored out into a common helper for both. +static UErrorCode GetEquivalentWindowsLocaleName(const Locale& locale, UnicodeString** buffer) +{ + UErrorCode status = U_ZERO_ERROR; + char asciiBCP47Tag[LOCALE_NAME_MAX_LENGTH] = {}; + + // Convert from names like "en_CA" and "de_DE@collation=phonebook" to "en-CA" and "de-DE-u-co-phonebk". + int32_t length = uloc_toLanguageTag(locale.getName(), asciiBCP47Tag, UPRV_LENGTHOF(asciiBCP47Tag), FALSE, &status); + + if (U_SUCCESS(status)) + { + // Need it to be UTF-16, not 8-bit + // TODO: This seems like a good thing for a helper + wchar_t bcp47Tag[LOCALE_NAME_MAX_LENGTH] = {}; + int i; + for (i = 0; i < UPRV_LENGTHOF(bcp47Tag); i++) + { + if (asciiBCP47Tag[i] == '\0') + { + break; + } + else + { + // normally just copy the character + bcp47Tag[i] = static_cast(asciiBCP47Tag[i]); + } + } + + // Ensure it's null terminated + if (i < (UPRV_LENGTHOF(bcp47Tag) - 1)) + { + bcp47Tag[i] = L'\0'; + } + else + { + // Ran out of room. + bcp47Tag[UPRV_LENGTHOF(bcp47Tag) - 1] = L'\0'; + } + + + wchar_t windowsLocaleName[LOCALE_NAME_MAX_LENGTH] = {}; + + // Note: On Windows versions below 10, there is no support for locale name aliases. + // This means that it will fail for locales where ICU has a completely different + // name (like ku vs ckb), and it will also not work for alternate sort locale + // names like "de-DE-u-co-phonebk". + + // TODO: We could add some sort of exception table for cases like ku vs ckb. + + int length = ResolveLocaleName(bcp47Tag, windowsLocaleName, UPRV_LENGTHOF(windowsLocaleName)); + + if (length > 0) + { + *buffer = new UnicodeString(windowsLocaleName); + } + else + { + status = U_UNSUPPORTED_ERROR; + } + } + return status; +} + // TODO: Range-check timeStyle, dateStyle Win32DateFormat::Win32DateFormat(DateFormat::EStyle timeStyle, DateFormat::EStyle dateStyle, const Locale &locale, UErrorCode &status) - : DateFormat(), fDateTimeMsg(NULL), fTimeStyle(timeStyle), fDateStyle(dateStyle), fLocale(locale), fZoneID() + : DateFormat(), fDateTimeMsg(NULL), fTimeStyle(timeStyle), fDateStyle(dateStyle), fLocale(locale), fZoneID(), fWindowsLocaleName(nullptr) { if (U_SUCCESS(status)) { - fLCID = locale.getLCID(); + GetEquivalentWindowsLocaleName(locale, &fWindowsLocaleName); + // Note: In the previous code, it would look up the LCID for the locale, and if + // the locale was not recognized then it would get an LCID of 0, which is a + // synonym for LOCALE_USER_DEFAULT on Windows. + // If the above method fails, then fWindowsLocaleName will remain as nullptr, and + // then we will pass nullptr to API GetLocaleInfoEx, which is the same as passing + // LOCALE_USER_DEFAULT. + fTZI = NEW_ARRAY(TIME_ZONE_INFORMATION, 1); uprv_memset(fTZI, 0, sizeof(TIME_ZONE_INFORMATION)); adoptCalendar(Calendar::createInstance(locale, status)); @@ -115,6 +188,7 @@ Win32DateFormat::~Win32DateFormat() // delete fCalendar; uprv_free(fTZI); delete fDateTimeMsg; + delete fWindowsLocaleName; } Win32DateFormat &Win32DateFormat::operator=(const Win32DateFormat &other) @@ -128,13 +202,14 @@ Win32DateFormat &Win32DateFormat::operator=(const Win32DateFormat &other) this->fTimeStyle = other.fTimeStyle; this->fDateStyle = other.fDateStyle; this->fLocale = other.fLocale; - this->fLCID = other.fLCID; // this->fCalendar = other.fCalendar->clone(); this->fZoneID = other.fZoneID; this->fTZI = NEW_ARRAY(TIME_ZONE_INFORMATION, 1); *this->fTZI = *other.fTZI; + this->fWindowsLocaleName = other.fWindowsLocaleName == NULL ? NULL : new UnicodeString(*other.fWindowsLocaleName); + return *this; } @@ -231,18 +306,25 @@ static const DWORD dfFlags[] = {DATE_LONGDATE, DATE_LONGDATE, DATE_SHORTDATE, DA void Win32DateFormat::formatDate(const SYSTEMTIME *st, UnicodeString &appendTo) const { - int result; + int result=0; wchar_t stackBuffer[STACK_BUFFER_SIZE]; wchar_t *buffer = stackBuffer; + const wchar_t *localeName = nullptr; - result = GetDateFormatW(fLCID, dfFlags[fDateStyle - kDateOffset], st, NULL, buffer, STACK_BUFFER_SIZE); + if (fWindowsLocaleName != nullptr) + { + localeName = reinterpret_cast(toOldUCharPtr(fWindowsLocaleName->getTerminatedBuffer())); + } + + result = GetDateFormatEx(localeName, dfFlags[fDateStyle - kDateOffset], st, NULL, buffer, STACK_BUFFER_SIZE, NULL); if (result == 0) { if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { - int newLength = GetDateFormatW(fLCID, dfFlags[fDateStyle - kDateOffset], st, NULL, NULL, 0); + int newLength = GetDateFormatEx(localeName, dfFlags[fDateStyle - kDateOffset], st, NULL, NULL, 0, NULL); buffer = NEW_ARRAY(wchar_t, newLength); - GetDateFormatW(fLCID, dfFlags[fDateStyle - kDateOffset], st, NULL, buffer, newLength); + + GetDateFormatEx(localeName, dfFlags[fDateStyle - kDateOffset], st, NULL, buffer, newLength, NULL); } } @@ -260,15 +342,22 @@ void Win32DateFormat::formatTime(const SYSTEMTIME *st, UnicodeString &appendTo) int result; wchar_t stackBuffer[STACK_BUFFER_SIZE]; wchar_t *buffer = stackBuffer; + const wchar_t *localeName = nullptr; - result = GetTimeFormatW(fLCID, tfFlags[fTimeStyle], st, NULL, buffer, STACK_BUFFER_SIZE); + if (fWindowsLocaleName != nullptr) + { + localeName = reinterpret_cast(toOldUCharPtr(fWindowsLocaleName->getTerminatedBuffer())); + } + + result = GetTimeFormatEx(localeName, tfFlags[fTimeStyle], st, NULL, buffer, STACK_BUFFER_SIZE); if (result == 0) { if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { - int newLength = GetTimeFormatW(fLCID, tfFlags[fTimeStyle], st, NULL, NULL, 0); + int newLength = GetTimeFormatEx(localeName, tfFlags[fTimeStyle], st, NULL, NULL, 0); buffer = NEW_ARRAY(wchar_t, newLength); - GetDateFormatW(fLCID, tfFlags[fTimeStyle], st, NULL, buffer, newLength); + + GetTimeFormatEx(localeName, tfFlags[fTimeStyle], st, NULL, buffer, newLength); } } diff --git a/icu4c/source/i18n/windtfmt.h b/icu4c/source/i18n/windtfmt.h index 492da150dc5..6d72a38e0cd 100644 --- a/icu4c/source/i18n/windtfmt.h +++ b/icu4c/source/i18n/windtfmt.h @@ -95,7 +95,7 @@ public: *
      * .   Base* polymorphic_pointer = createPolymorphicObject();
      * .   if (polymorphic_pointer->getDynamicClassID() ==
-     * .       erived::getStaticClassID()) ...
+     * .       derived::getStaticClassID()) ...
      * 
* @return The class ID for all objects of this class. */ @@ -124,9 +124,10 @@ private: DateFormat::EStyle fTimeStyle; DateFormat::EStyle fDateStyle; Locale fLocale; - int32_t fLCID; UnicodeString fZoneID; TIME_ZONE_INFORMATION *fTZI; + + UnicodeString* fWindowsLocaleName; // Stores the equivalent Windows locale name. }; U_NAMESPACE_END diff --git a/icu4c/source/i18n/winnmfmt.cpp b/icu4c/source/i18n/winnmfmt.cpp index 5b4a191747b..3f8271efaf0 100644 --- a/icu4c/source/i18n/winnmfmt.cpp +++ b/icu4c/source/i18n/winnmfmt.cpp @@ -28,7 +28,9 @@ #include "uassert.h" #include "locmap.h" +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN +#endif # define VC_EXTRALEAN # define NOUSER # define NOSERVICE @@ -58,43 +60,43 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(Win32NumberFormat) * end in ";0" then the return value should be multiplied by 10. * (e.g. "3" => 30, "3;2" => 320) */ -static UINT getGrouping(const char *grouping) +static UINT getGrouping(const wchar_t *grouping) { UINT g = 0; - const char *s; + const wchar_t *s; - for (s = grouping; *s != '\0'; s += 1) { - if (*s > '0' && *s < '9') { - g = g * 10 + (*s - '0'); - } else if (*s != ';') { + for (s = grouping; *s != L'\0'; s += 1) { + if (*s > L'0' && *s < L'9') { + g = g * 10 + (*s - L'0'); + } else if (*s != L';') { break; } } - if (*s != '0') { + if (*s != L'0') { g *= 10; } return g; } -static void getNumberFormat(NUMBERFMTW *fmt, int32_t lcid) +static void getNumberFormat(NUMBERFMTW *fmt, const wchar_t *windowsLocaleName) { - char buf[10]; + wchar_t buf[10]; - GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_IDIGITS, (LPWSTR) &fmt->NumDigits, sizeof(UINT)); - GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_ILZERO, (LPWSTR) &fmt->LeadingZero, sizeof(UINT)); + GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_IDIGITS, (LPWSTR) &fmt->NumDigits, sizeof(UINT)); + GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_ILZERO, (LPWSTR) &fmt->LeadingZero, sizeof(UINT)); - GetLocaleInfoA(lcid, LOCALE_SGROUPING, buf, 10); + GetLocaleInfoEx(windowsLocaleName, LOCALE_SGROUPING, (LPWSTR)buf, 10); fmt->Grouping = getGrouping(buf); fmt->lpDecimalSep = NEW_ARRAY(wchar_t, 6); - GetLocaleInfoW(lcid, LOCALE_SDECIMAL, fmt->lpDecimalSep, 6); + GetLocaleInfoEx(windowsLocaleName, LOCALE_SDECIMAL, fmt->lpDecimalSep, 6); fmt->lpThousandSep = NEW_ARRAY(wchar_t, 6); - GetLocaleInfoW(lcid, LOCALE_STHOUSAND, fmt->lpThousandSep, 6); + GetLocaleInfoEx(windowsLocaleName, LOCALE_STHOUSAND, fmt->lpThousandSep, 6); - GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_INEGNUMBER, (LPWSTR) &fmt->NegativeOrder, sizeof(UINT)); + GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_INEGNUMBER, (LPWSTR) &fmt->NegativeOrder, sizeof(UINT)); } static void freeNumberFormat(NUMBERFMTW *fmt) @@ -105,27 +107,27 @@ static void freeNumberFormat(NUMBERFMTW *fmt) } } -static void getCurrencyFormat(CURRENCYFMTW *fmt, int32_t lcid) +static void getCurrencyFormat(CURRENCYFMTW *fmt, const wchar_t *windowsLocaleName) { - char buf[10]; + wchar_t buf[10]; - GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_ICURRDIGITS, (LPWSTR) &fmt->NumDigits, sizeof(UINT)); - GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_ILZERO, (LPWSTR) &fmt->LeadingZero, sizeof(UINT)); + GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_ICURRDIGITS, (LPWSTR) &fmt->NumDigits, sizeof(UINT)); + GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_ILZERO, (LPWSTR) &fmt->LeadingZero, sizeof(UINT)); - GetLocaleInfoA(lcid, LOCALE_SMONGROUPING, buf, sizeof(buf)); + GetLocaleInfoEx(windowsLocaleName, LOCALE_SMONGROUPING, (LPWSTR)buf, sizeof(buf)); fmt->Grouping = getGrouping(buf); fmt->lpDecimalSep = NEW_ARRAY(wchar_t, 6); - GetLocaleInfoW(lcid, LOCALE_SMONDECIMALSEP, fmt->lpDecimalSep, 6); + GetLocaleInfoEx(windowsLocaleName, LOCALE_SMONDECIMALSEP, fmt->lpDecimalSep, 6); fmt->lpThousandSep = NEW_ARRAY(wchar_t, 6); - GetLocaleInfoW(lcid, LOCALE_SMONTHOUSANDSEP, fmt->lpThousandSep, 6); + GetLocaleInfoEx(windowsLocaleName, LOCALE_SMONTHOUSANDSEP, fmt->lpThousandSep, 6); - GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_INEGCURR, (LPWSTR) &fmt->NegativeOrder, sizeof(UINT)); - GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_ICURRENCY, (LPWSTR) &fmt->PositiveOrder, sizeof(UINT)); + GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_INEGCURR, (LPWSTR) &fmt->NegativeOrder, sizeof(UINT)); + GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_ICURRENCY, (LPWSTR) &fmt->PositiveOrder, sizeof(UINT)); fmt->lpCurrencySymbol = NEW_ARRAY(wchar_t, 8); - GetLocaleInfoW(lcid, LOCALE_SCURRENCY, (LPWSTR) fmt->lpCurrencySymbol, 8); + GetLocaleInfoEx(windowsLocaleName, LOCALE_SCURRENCY, (LPWSTR) fmt->lpCurrencySymbol, 8); } static void freeCurrencyFormat(CURRENCYFMTW *fmt) @@ -137,12 +139,84 @@ static void freeCurrencyFormat(CURRENCYFMTW *fmt) } } +// TODO: This is copied in both winnmfmt.cpp and windtfmt.cpp, but really should +// be factored out into a common helper for both. +static UErrorCode GetEquivalentWindowsLocaleName(const Locale& locale, UnicodeString** buffer) +{ + UErrorCode status = U_ZERO_ERROR; + char asciiBCP47Tag[LOCALE_NAME_MAX_LENGTH] = {}; + + // Convert from names like "en_CA" and "de_DE@collation=phonebook" to "en-CA" and "de-DE-u-co-phonebk". + int32_t length = uloc_toLanguageTag(locale.getName(), asciiBCP47Tag, UPRV_LENGTHOF(asciiBCP47Tag), FALSE, &status); + + if (U_SUCCESS(status)) + { + // Need it to be UTF-16, not 8-bit + // TODO: This seems like a good thing for a helper + wchar_t bcp47Tag[LOCALE_NAME_MAX_LENGTH] = {}; + int i; + for (i = 0; i < UPRV_LENGTHOF(bcp47Tag); i++) + { + if (asciiBCP47Tag[i] == '\0') + { + break; + } + else + { + // normally just copy the character + bcp47Tag[i] = static_cast(asciiBCP47Tag[i]); + } + } + + // Ensure it's null terminated + if (i < (UPRV_LENGTHOF(bcp47Tag) - 1)) + { + bcp47Tag[i] = L'\0'; + } + else + { + // Ran out of room. + bcp47Tag[UPRV_LENGTHOF(bcp47Tag) - 1] = L'\0'; + } + + + wchar_t windowsLocaleName[LOCALE_NAME_MAX_LENGTH] = {}; + + // Note: On Windows versions below 10, there is no support for locale name aliases. + // This means that it will fail for locales where ICU has a completely different + // name (like ku vs ckb), and it will also not work for alternate sort locale + // names like "de-DE-u-co-phonebk". + + // TODO: We could add some sort of exception table for cases like ku vs ckb. + + int length = ResolveLocaleName(bcp47Tag, windowsLocaleName, UPRV_LENGTHOF(windowsLocaleName)); + + if (length > 0) + { + *buffer = new UnicodeString(windowsLocaleName); + } + else + { + status = U_UNSUPPORTED_ERROR; + } + } + return status; +} + Win32NumberFormat::Win32NumberFormat(const Locale &locale, UBool currency, UErrorCode &status) - : NumberFormat(), fCurrency(currency), fFormatInfo(NULL), fFractionDigitsSet(FALSE) + : NumberFormat(), fCurrency(currency), fFormatInfo(NULL), fFractionDigitsSet(FALSE), fWindowsLocaleName(nullptr) { if (!U_FAILURE(status)) { fLCID = locale.getLCID(); + GetEquivalentWindowsLocaleName(locale, &fWindowsLocaleName); + // Note: In the previous code, it would look up the LCID for the locale, and if + // the locale was not recognized then it would get an LCID of 0, which is a + // synonym for LOCALE_USER_DEFAULT on Windows. + // If the above method fails, then fWindowsLocaleName will remain as nullptr, and + // then we will pass nullptr to API GetLocaleInfoEx, which is the same as passing + // LOCALE_USER_DEFAULT. + // Resolve actual locale to be used later UErrorCode tmpsts = U_ZERO_ERROR; char tmpLocID[ULOC_FULLNAME_CAPACITY]; @@ -152,12 +226,19 @@ Win32NumberFormat::Win32NumberFormat(const Locale &locale, UBool currency, UErro fLocale = Locale((const char*)tmpLocID); } + const wchar_t *localeName = nullptr; + + if (fWindowsLocaleName != nullptr) + { + localeName = reinterpret_cast(toOldUCharPtr(fWindowsLocaleName->getTerminatedBuffer())); + } + fFormatInfo = (FormatInfo*)uprv_malloc(sizeof(FormatInfo)); if (fCurrency) { - getCurrencyFormat(&fFormatInfo->currency, fLCID); + getCurrencyFormat(&fFormatInfo->currency, localeName); } else { - getNumberFormat(&fFormatInfo->number, fLCID); + getNumberFormat(&fFormatInfo->number, localeName); } } } @@ -182,6 +263,7 @@ Win32NumberFormat::~Win32NumberFormat() uprv_free(fFormatInfo); } + delete fWindowsLocaleName; } Win32NumberFormat &Win32NumberFormat::operator=(const Win32NumberFormat &other) @@ -192,13 +274,21 @@ Win32NumberFormat &Win32NumberFormat::operator=(const Win32NumberFormat &other) this->fLocale = other.fLocale; this->fLCID = other.fLCID; this->fFractionDigitsSet = other.fFractionDigitsSet; + this->fWindowsLocaleName = other.fWindowsLocaleName == NULL ? NULL : new UnicodeString(*other.fWindowsLocaleName); + + const wchar_t *localeName = nullptr; + + if (fWindowsLocaleName != nullptr) + { + localeName = reinterpret_cast(toOldUCharPtr(fWindowsLocaleName->getTerminatedBuffer())); + } if (fCurrency) { freeCurrencyFormat(&fFormatInfo->currency); - getCurrencyFormat(&fFormatInfo->currency, fLCID); + getCurrencyFormat(&fFormatInfo->currency, localeName); } else { freeNumberFormat(&fFormatInfo->number); - getNumberFormat(&fFormatInfo->number, fLCID); + getNumberFormat(&fFormatInfo->number, localeName); } return *this; @@ -299,6 +389,13 @@ UnicodeString &Win32NumberFormat::format(int32_t numDigits, UnicodeString &appen formatInfo = *fFormatInfo; buffer[0] = 0x0000; + const wchar_t *localeName = nullptr; + + if (fWindowsLocaleName != nullptr) + { + localeName = reinterpret_cast(toOldUCharPtr(fWindowsLocaleName->getTerminatedBuffer())); + } + if (fCurrency) { if (fFractionDigitsSet) { formatInfo.currency.NumDigits = (UINT) numDigits; @@ -308,17 +405,17 @@ UnicodeString &Win32NumberFormat::format(int32_t numDigits, UnicodeString &appen formatInfo.currency.Grouping = 0; } - result = GetCurrencyFormatW(fLCID, 0, nBuffer, &formatInfo.currency, buffer, STACK_BUFFER_SIZE); + result = GetCurrencyFormatEx(localeName, 0, nBuffer, &formatInfo.currency, buffer, STACK_BUFFER_SIZE); if (result == 0) { DWORD lastError = GetLastError(); if (lastError == ERROR_INSUFFICIENT_BUFFER) { - int newLength = GetCurrencyFormatW(fLCID, 0, nBuffer, &formatInfo.currency, NULL, 0); + int newLength = GetCurrencyFormatEx(localeName, 0, nBuffer, &formatInfo.currency, NULL, 0); buffer = NEW_ARRAY(wchar_t, newLength); buffer[0] = 0x0000; - GetCurrencyFormatW(fLCID, 0, nBuffer, &formatInfo.currency, buffer, newLength); + GetCurrencyFormatEx(localeName, 0, nBuffer, &formatInfo.currency, buffer, newLength); } } } else { @@ -330,15 +427,15 @@ UnicodeString &Win32NumberFormat::format(int32_t numDigits, UnicodeString &appen formatInfo.number.Grouping = 0; } - result = GetNumberFormatW(fLCID, 0, nBuffer, &formatInfo.number, buffer, STACK_BUFFER_SIZE); + result = GetNumberFormatEx(localeName, 0, nBuffer, &formatInfo.number, buffer, STACK_BUFFER_SIZE); if (result == 0) { if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { - int newLength = GetNumberFormatW(fLCID, 0, nBuffer, &formatInfo.number, NULL, 0); + int newLength = GetNumberFormatEx(localeName, 0, nBuffer, &formatInfo.number, NULL, 0); buffer = NEW_ARRAY(wchar_t, newLength); buffer[0] = 0x0000; - GetNumberFormatW(fLCID, 0, nBuffer, &formatInfo.number, buffer, newLength); + GetNumberFormatEx(localeName, 0, nBuffer, &formatInfo.number, buffer, newLength); } } } diff --git a/icu4c/source/i18n/winnmfmt.h b/icu4c/source/i18n/winnmfmt.h index 1b1977152e9..6139c1ff68a 100644 --- a/icu4c/source/i18n/winnmfmt.h +++ b/icu4c/source/i18n/winnmfmt.h @@ -128,7 +128,7 @@ public: *
      * .   Base* polymorphic_pointer = createPolymorphicObject();
      * .   if (polymorphic_pointer->getDynamicClassID() ==
-     * .       erived::getStaticClassID()) ...
+     * .       derived::getStaticClassID()) ...
      * 
* @return The class ID for all objects of this class. */ @@ -155,6 +155,7 @@ private: FormatInfo *fFormatInfo; UBool fFractionDigitsSet; + UnicodeString* fWindowsLocaleName; // Stores the equivalent Windows locale name. }; U_NAMESPACE_END diff --git a/icu4c/source/i18n/wintzimpl.cpp b/icu4c/source/i18n/wintzimpl.cpp index 78629e5f485..5a29f29a77a 100644 --- a/icu4c/source/i18n/wintzimpl.cpp +++ b/icu4c/source/i18n/wintzimpl.cpp @@ -24,7 +24,9 @@ #include "uassert.h" #include "cmemory.h" +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN +#endif # define VC_EXTRALEAN # define NOUSER # define NOSERVICE diff --git a/icu4c/source/test/intltest/winutil.cpp b/icu4c/source/test/intltest/winutil.cpp index 1f998e33cbf..87b2d402e83 100644 --- a/icu4c/source/test/intltest/winutil.cpp +++ b/icu4c/source/test/intltest/winutil.cpp @@ -36,6 +36,7 @@ static Win32Utilities::LCIDRecord *lcidRecords = NULL; static int32_t lcidCount = 0; static int32_t lcidMax = 0; +// TODO: Note that this test will skip locale names and only hit locales with assigned LCIDs BOOL CALLBACK EnumLocalesProc(LPSTR lpLocaleString) { char localeID[ULOC_FULLNAME_CAPACITY]; @@ -70,6 +71,7 @@ BOOL CALLBACK EnumLocalesProc(LPSTR lpLocaleString) return TRUE; } +// TODO: Note that this test will skip locale names and only hit locales with assigned LCIDs Win32Utilities::LCIDRecord *Win32Utilities::getLocales(int32_t &localeCount) { LCIDRecord *result; diff --git a/icu4c/source/tools/pkgdata/pkgdata.cpp b/icu4c/source/tools/pkgdata/pkgdata.cpp index 432552160b6..ffcf459c349 100644 --- a/icu4c/source/tools/pkgdata/pkgdata.cpp +++ b/icu4c/source/tools/pkgdata/pkgdata.cpp @@ -121,7 +121,9 @@ enum { LIBNAME, QUIET, WITHOUT_ASSEMBLY, - PDS_BUILD + PDS_BUILD, + UWP_BUILD, + UWP_ARM_BUILD }; /* This sets the modes that are available */ @@ -163,7 +165,9 @@ static UOption options[]={ /*18*/ UOPTION_DEF( "libname", 'L', UOPT_REQUIRES_ARG), /*19*/ UOPTION_DEF( "quiet", 'q', UOPT_NO_ARG), /*20*/ UOPTION_DEF( "without-assembly", 'w', UOPT_NO_ARG), - /*21*/ UOPTION_DEF( "zos-pds-build", 'z', UOPT_NO_ARG) + /*21*/ UOPTION_DEF("zos-pds-build", 'z', UOPT_NO_ARG), + /*22*/ UOPTION_DEF("windows-uwp-build", 'u', UOPT_NO_ARG), + /*23*/ UOPTION_DEF("windows-uwp-arm-build", 'a', UOPT_NO_ARG) }; /* This enum and the following char array should be kept in sync. */ @@ -250,9 +254,11 @@ const char options_help[][320]={ "Specify a version when packaging in dll or static mode", "Add package to all file names if not present", "Library name to build (if different than package name)", - "Quite mode. (e.g. Do not output a readme file for static libraries)", + "Quiet mode. (e.g. Do not output a readme file for static libraries)", "Build the data without assembly code", - "Build PDS dataset (zOS build only)" + "Build PDS dataset (zOS build only)", + "Build for Universal Windows Platform (Windows build only)", + "Set DLL machine type for UWP to target windows ARM (Windows UWP build only)" }; const char *progname = "PKGDATA"; @@ -1751,7 +1757,14 @@ static int32_t pkg_createWithoutAssemblyCode(UPKGOptions *o, const char *targetD #ifdef WINDOWS_WITH_MSVC #define LINK_CMD "link.exe /nologo /release /out:" -#define LINK_FLAGS "/DLL /NOENTRY /MANIFEST:NO /base:0x4ad00000 /implib:" +#define LINK_FLAGS "/DLL /NOENTRY /MANIFEST:NO /implib:" +#ifdef _WIN64 +#define LINK_EXTRA_UWP_FLAGS "/NXCOMPAT /DYNAMICBASE /APPCONTAINER " +#else +#define LINK_EXTRA_UWP_FLAGS "/NXCOMPAT /SAFESEH /DYNAMICBASE /APPCONTAINER /MACHINE:X86" +#endif +#define LINK_EXTRA_UWP_FLAGS_ARM "/NXCOMPAT /DYNAMICBASE /APPCONTAINER /MACHINE:ARM" +#define LINK_EXTRA_NO_UWP_FLAGS "/base:0x4ad00000 " #define LIB_CMD "LIB.exe /nologo /out:" #define LIB_FILE "icudt.lib" #define LIB_EXT UDATA_LIB_SUFFIX @@ -1831,14 +1844,33 @@ static int32_t pkg_createWindowsDLL(const char mode, const char *gencFilePath, U return 0; } - sprintf(cmd, "%s\"%s\" %s\"%s\" \"%s\" %s", - LINK_CMD, - dllFilePath, - LINK_FLAGS, - libFilePath, - gencFilePath, - resFilePath - ); + char *extraFlags = ""; +#ifdef WINDOWS_WITH_MSVC + if (options[UWP_BUILD].doesOccur) + { + if (options[UWP_ARM_BUILD].doesOccur) + { + extraFlags = LINK_EXTRA_UWP_FLAGS_ARM; + } + else + { + extraFlags = LINK_EXTRA_UWP_FLAGS; + } + } + else + { + extraFlags = LINK_EXTRA_NO_UWP_FLAGS; + } +#endif + sprintf(cmd, "%s\"%s\" %s %s\"%s\" \"%s\" %s", + LINK_CMD, + dllFilePath, + extraFlags, + LINK_FLAGS, + libFilePath, + gencFilePath, + resFilePath + ); } result = runCommand(cmd, TRUE); diff --git a/icu4c/source/tools/toolutil/pkg_genc.cpp b/icu4c/source/tools/toolutil/pkg_genc.cpp index 9ff6ce56df8..e4d11956bdc 100644 --- a/icu4c/source/tools/toolutil/pkg_genc.cpp +++ b/icu4c/source/tools/toolutil/pkg_genc.cpp @@ -687,12 +687,19 @@ getArchitecture(uint16_t *pCPU, uint16_t *pBits, UBool *pIsBigEndian, const char /* _M_IA64 should be defined in windows.h */ # if defined(_M_IA64) *pCPU=IMAGE_FILE_MACHINE_IA64; + *pBits = 64; # elif defined(_M_AMD64) - *pCPU=IMAGE_FILE_MACHINE_AMD64; +// link.exe does not really care about the .obj machine type and this will +// allow us to build a dll for both ARM & x64 with an amd64 built tool +// ARM is same as x64 except for first 2 bytes of object file + *pCPU = IMAGE_FILE_MACHINE_UNKNOWN; + // *pCPU = IMAGE_FILE_MACHINE_ARMNT; // If we wanted to be explicit + // *pCPU = IMAGE_FILE_MACHINE_AMD64; // We would use one of these names + *pBits = 64; // Doesn't seem to be used for anything interesting? # else - *pCPU=IMAGE_FILE_MACHINE_I386; + *pCPU=IMAGE_FILE_MACHINE_I386; // We would use one of these names + *pBits = 32; # endif - *pBits= *pCPU==IMAGE_FILE_MACHINE_I386 ? 32 : 64; *pIsBigEndian=FALSE; #else # error "Unknown platform for CAN_GENERATE_OBJECTS." @@ -1030,7 +1037,14 @@ writeObjectCode(const char *filename, const char *destdir, const char *optEntryP /* deal with options, files and the entry point name */ getArchitecture(&cpu, &bits, &makeBigEndian, optMatchArch); - printf("genccode: --match-arch cpu=%hu bits=%hu big-endian=%d\n", cpu, bits, makeBigEndian); + if (optMatchArch) + { + printf("genccode: --match-arch cpu=%hu bits=%hu big-endian=%d\n", cpu, bits, makeBigEndian); + } + else + { + printf("genccode: using architecture cpu=%hu bits=%hu big-endian=%d\n", cpu, bits, makeBigEndian); + } #if U_PLATFORM_HAS_WIN32_API if(cpu==IMAGE_FILE_MACHINE_I386) { entryOffset=1; -- 2.40.0