ICU-13027 - Merge in changes from 'branches/shawnste/working/icu4c'

X-SVN-Rev: 39890
This commit is contained in:
Jeff Genovy 2017-03-21 01:03:49 +00:00
parent 83ddd2563b
commit e9946ec98e
33 changed files with 3283 additions and 213 deletions

2
.gitignore vendored
View file

@ -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

View file

@ -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

File diff suppressed because it is too large Load diff

View file

@ -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 <windows.h>
#include <winnls.h>
#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<wchar_t>(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) */
}

View file

@ -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 */

View file

@ -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)

View file

@ -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 <windows.h>
# 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 <Windows.Globalization.h>
#include <windows.system.userprofile.h>
#include <wrl\wrappers\corewrappers.h>
#include <wrl\client.h>
using namespace ABI::Windows::Foundation;
using namespace Microsoft::WRL;
using namespace Microsoft::WRL::Wrappers;
#endif
#elif U_PLATFORM == U_PF_OS400
# include <float.h>
# include <qusec.h> /* 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<IInspectable> calendar;
HRESULT hr = RoActivateInstance(
HStringReference(RuntimeClass_Windows_Globalization_Calendar).Get(),
&calendar);
if (SUCCEEDED(hr))
{
ComPtr<ABI::Windows::Globalization::ITimeZoneOnCalendar> 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<char *>(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<ABI::Windows::Foundation::Collections::IVectorView<HSTRING>> languageList;
ComPtr<ABI::Windows::Globalization::IApplicationLanguagesStatics> 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<ABI::Windows::System::UserProfile::IGlobalizationPreferencesStatics> 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<char>(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];

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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)) {

View file

@ -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;

View file

@ -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;

View file

@ -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

View file

@ -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;
/**

View file

@ -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.

View file

@ -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);
/**

View file

@ -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

View file

@ -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.

View file

@ -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) */

View file

@ -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 */

View file

@ -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
)
<<KEEP
-@erase "$(ICU_LIB_TARGET)"
@if not exist "$(DLL_OUTPUT)" mkdir "$(DLL_OUTPUT)"
copy "$(U_ICUDATA_NAME).dll" "$(ICU_LIB_TARGET)"
-@erase "$(U_ICUDATA_NAME).dll"
copy "$(ICUTMP)\$(ICUPKG).dat" "$(ICUOUT)\$(U_ICUDATA_NAME)$(U_ICUDATA_ENDIAN_SUFFIX).dat"
@ -757,40 +790,40 @@ CLEAN : GODATA
# RBBI .brk file generation.
{$(ICUSRCDATA_RELATIVE_PATH)\$(ICUBRK)\rules}.txt.brk:
@echo Creating $@
@"$(ICUTOOLS)\genbrk\$(CFG)\genbrk" -c -r $< -o $@ -d"$(ICUBLD_PKG)" -i "$(ICUBLD_PKG)"
@"$(ICUTOOLS)\genbrk\$(CFGTOOLS)\genbrk" -c -r $< -o $@ -d"$(ICUBLD_PKG)" -i "$(ICUBLD_PKG)"
#RBBI .dict file generation.
{$(ICUSRCDATA_RELATIVE_PATH)\$(ICUBRK)\dictionaries}.txt.dict:
@echo Creating $@
@"$(ICUTOOLS)\gendict\$(CFG)\gendict" -c --uchars $< "$(ICUBLD_PKG)\$@"
@"$(ICUTOOLS)\gendict\$(CFGTOOLS)\gendict" -c --uchars $< "$(ICUBLD_PKG)\$@"
$(ICUBRK)\thaidict.dict:
@echo Creating $(ICUBRK)\thaidict.dict
@"$(ICUTOOLS)\gendict\$(CFG)\gendict" -c --bytes --transform offset-0x0e00 $(ICUSRCDATA_RELATIVE_PATH)\$(ICUBRK)\dictionaries\thaidict.txt "$(ICUBLD_PKG)\$(ICUBRK)\thaidict.dict"
@"$(ICUTOOLS)\gendict\$(CFGTOOLS)\gendict" -c --bytes --transform offset-0x0e00 $(ICUSRCDATA_RELATIVE_PATH)\$(ICUBRK)\dictionaries\thaidict.txt "$(ICUBLD_PKG)\$(ICUBRK)\thaidict.dict"
$(ICUBRK)\laodict.dict:
@echo Creating $(ICUBRK)\laodict.dict
@"$(ICUTOOLS)\gendict\$(CFG)\gendict" -c --bytes --transform offset-0x0e80 $(ICUSRCDATA_RELATIVE_PATH)\$(ICUBRK)\dictionaries\laodict.txt "$(ICUBLD_PKG)\$(ICUBRK)\laodict.dict"
@"$(ICUTOOLS)\gendict\$(CFGTOOLS)\gendict" -c --bytes --transform offset-0x0e80 $(ICUSRCDATA_RELATIVE_PATH)\$(ICUBRK)\dictionaries\laodict.txt "$(ICUBLD_PKG)\$(ICUBRK)\laodict.dict"
$(ICUBRK)\burmesedict.dict:
@echo Creating $(ICUBRK)\burmesedict.dict
@"$(ICUTOOLS)\gendict\$(CFG)\gendict" -c --bytes --transform offset-0x1000 $(ICUSRCDATA_RELATIVE_PATH)\$(ICUBRK)\dictionaries\burmesedict.txt "$(ICUBLD_PKG)\$(ICUBRK)\burmesedict.dict"
@"$(ICUTOOLS)\gendict\$(CFGTOOLS)\gendict" -c --bytes --transform offset-0x1000 $(ICUSRCDATA_RELATIVE_PATH)\$(ICUBRK)\dictionaries\burmesedict.txt "$(ICUBLD_PKG)\$(ICUBRK)\burmesedict.dict"
$(ICUBRK)\khmerdict.dict:
@echo Creating $(ICUBRK)\khmerdict.dict
@"$(ICUTOOLS)\gendict\$(CFG)\gendict" -c --bytes --transform offset-0x1780 $(ICUSRCDATA_RELATIVE_PATH)\$(ICUBRK)\dictionaries\khmerdict.txt "$(ICUBLD_PKG)\$(ICUBRK)\khmerdict.dict"
@"$(ICUTOOLS)\gendict\$(CFGTOOLS)\gendict" -c --bytes --transform offset-0x1780 $(ICUSRCDATA_RELATIVE_PATH)\$(ICUBRK)\dictionaries\khmerdict.txt "$(ICUBLD_PKG)\$(ICUBRK)\khmerdict.dict"
!IFNDEF ICUDATA_SOURCE_ARCHIVE
# Rule for creating converters
$(CNV_FILES): $(UCM_SOURCE)
@echo Building Charset Conversion table $(@B)
@"$(ICUTOOLS)\makeconv\$(CFG)\makeconv" -c -d"$(ICUBLD_PKG)" $(ICUSRCDATA_RELATIVE_PATH)\$(ICUUCM)\$(@B).ucm
@"$(ICUTOOLS)\makeconv\$(CFGTOOLS)\makeconv" -c -d"$(ICUBLD_PKG)" $(ICUSRCDATA_RELATIVE_PATH)\$(ICUUCM)\$(@B).ucm
!ENDIF
!IFDEF BUILD_SPECIAL_CNV_FILES
$(CNV_FILES_SPECIAL): $(UCM_SOURCE_SPECIAL)
@echo Building Special Charset Conversion table $(@B)
@"$(ICUTOOLS)\makeconv\$(CFG)\makeconv" -c --ignore-siso-check -d"$(ICUBLD_PKG)" $(ICUSRCDATA_RELATIVE_PATH)\$(ICUUCM)\$(@B).ucm
@"$(ICUTOOLS)\makeconv\$(CFGTOOLS)\makeconv" -c --ignore-siso-check -d"$(ICUBLD_PKG)" $(ICUSRCDATA_RELATIVE_PATH)\$(ICUUCM)\$(@B).ucm
!ENDIF
# Batch inference rule for creating miscellaneous resource files
@ -800,12 +833,12 @@ $(CNV_FILES_SPECIAL): $(UCM_SOURCE_SPECIAL)
# way, remove the -q.
{$(ICUSRCDATA_RELATIVE_PATH)\$(ICUMISC2)}.txt.res::
@echo Making Miscellaneous Resource Bundle files
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" -k -q -d"$(ICUBLD_PKG)" $<
@"$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb" -k -q -d"$(ICUBLD_PKG)" $<
# Inference rule for creating resource bundle files
{$(ICUSRCDATA_RELATIVE_PATH)\$(ICULOC)}.txt.res::
@echo Making Locale Resource Bundle files
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" --usePoolBundle $(ICUSRCDATA_RELATIVE_PATH)\$(ICULOC) -k -d"$(ICUBLD_PKG)" $<
@"$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb" --usePoolBundle $(ICUSRCDATA_RELATIVE_PATH)\$(ICULOC) -k -d"$(ICUBLD_PKG)" $<
# copy the locales/pool.res file from the source folder to the build output folder
# and swap it to native endianness
@ -822,12 +855,12 @@ res_index:table(nofallback) {
}
}
<<KEEP
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" -k -d"$(ICUBLD_PKG)" .\res_index.txt
@"$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb" -k -d"$(ICUBLD_PKG)" .\res_index.txt
{$(ICUSRCDATA_RELATIVE_PATH)\curr}.txt{curr}.res::
@echo Making currency display name files
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" --usePoolBundle $(ICUSRCDATA_RELATIVE_PATH)\curr -k -i "$(ICUBLD_PKG)" -d"$(ICUBLD_PKG)\curr" $<
@"$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb" --usePoolBundle $(ICUSRCDATA_RELATIVE_PATH)\curr -k -i "$(ICUBLD_PKG)" -d"$(ICUBLD_PKG)\curr" $<
# copy the curr/pool.res file from the source folder to the build output folder
# and swap it to native endianness
@ -844,12 +877,12 @@ res_index:table(nofallback) {
}
}
<<KEEP
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" -k -d"$(ICUBLD_PKG)\curr" .\curr\res_index.txt
@"$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb" -k -d"$(ICUBLD_PKG)\curr" .\curr\res_index.txt
{$(ICUSRCDATA_RELATIVE_PATH)\lang}.txt{lang}.res::
@echo Making language/script display name files
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" --usePoolBundle $(ICUSRCDATA_RELATIVE_PATH)\lang -k -i "$(ICUBLD_PKG)" -d"$(ICUBLD_PKG)\lang" $<
@"$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb" --usePoolBundle $(ICUSRCDATA_RELATIVE_PATH)\lang -k -i "$(ICUBLD_PKG)" -d"$(ICUBLD_PKG)\lang" $<
# copy the lang/pool.res file from the source folder to the build output folder
# and swap it to native endianness
@ -866,12 +899,12 @@ res_index:table(nofallback) {
}
}
<<KEEP
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" -k -d"$(ICUBLD_PKG)\lang" .\lang\res_index.txt
@"$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb" -k -d"$(ICUBLD_PKG)\lang" .\lang\res_index.txt
{$(ICUSRCDATA_RELATIVE_PATH)\region}.txt{region}.res::
@echo Making region display name files
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" --usePoolBundle $(ICUSRCDATA_RELATIVE_PATH)\region -k -i "$(ICUBLD_PKG)" -d"$(ICUBLD_PKG)\region" $<
@"$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb" --usePoolBundle $(ICUSRCDATA_RELATIVE_PATH)\region -k -i "$(ICUBLD_PKG)" -d"$(ICUBLD_PKG)\region" $<
# copy the region/pool.res file from the source folder to the build output folder
# and swap it to native endianness
@ -888,12 +921,12 @@ res_index:table(nofallback) {
}
}
<<KEEP
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" -k -d"$(ICUBLD_PKG)\region" .\region\res_index.txt
@"$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb" -k -d"$(ICUBLD_PKG)\region" .\region\res_index.txt
{$(ICUSRCDATA_RELATIVE_PATH)\zone}.txt{zone}.res::
@echo Making time zone display name files
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" --usePoolBundle $(ICUSRCDATA_RELATIVE_PATH)\zone -k -i "$(ICUBLD_PKG)" -d"$(ICUBLD_PKG)\zone" $<
@"$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb" --usePoolBundle $(ICUSRCDATA_RELATIVE_PATH)\zone -k -i "$(ICUBLD_PKG)" -d"$(ICUBLD_PKG)\zone" $<
# copy the zone/pool.res file from the source folder to the build output folder
# and swap it to native endianness
@ -910,12 +943,12 @@ res_index:table(nofallback) {
}
}
<<KEEP
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" -k -d"$(ICUBLD_PKG)\zone" .\zone\res_index.txt
@"$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb" -k -d"$(ICUBLD_PKG)\zone" .\zone\res_index.txt
{$(ICUSRCDATA_RELATIVE_PATH)\unit}.txt{unit}.res::
@echo Making unit display name files
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" --usePoolBundle $(ICUSRCDATA_RELATIVE_PATH)\unit -k -i "$(ICUBLD_PKG)" -d"$(ICUBLD_PKG)\unit" $<
@"$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb" --usePoolBundle $(ICUSRCDATA_RELATIVE_PATH)\unit -k -i "$(ICUBLD_PKG)" -d"$(ICUBLD_PKG)\unit" $<
# copy the unit/pool.res file from the source folder to the build output folder
# and swap it to native endianness
@ -932,12 +965,12 @@ res_index:table(nofallback) {
}
}
<<KEEP
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" -k -d"$(ICUBLD_PKG)\unit" .\unit\res_index.txt
@"$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb" -k -d"$(ICUBLD_PKG)\unit" .\unit\res_index.txt
{$(ICUSRCDATA_RELATIVE_PATH)\$(ICUCOL)}.txt{$(ICUCOL)}.res::
@echo Making Collation files
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" -k -i "$(ICUBLD_PKG)" -d"$(ICUBLD_PKG)\$(ICUCOL)" $<
@"$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb" -k -i "$(ICUBLD_PKG)" -d"$(ICUBLD_PKG)\$(ICUCOL)" $<
$(ICUCOL)\res_index.res:
@echo Generating <<$(ICUCOL)\res_index.txt
@ -949,11 +982,11 @@ res_index:table(nofallback) {
}
}
<<KEEP
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" -k -d"$(ICUBLD_PKG)\$(ICUCOL)" .\$(ICUCOL)\res_index.txt
@"$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb" -k -d"$(ICUBLD_PKG)\$(ICUCOL)" .\$(ICUCOL)\res_index.txt
{$(ICUSRCDATA_RELATIVE_PATH)\$(ICURBNF)}.txt{$(ICURBNF)}.res::
@echo Making RBNF files
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" -k -i "$(ICUBLD_PKG)" -d"$(ICUBLD_PKG)\$(ICURBNF)" $<
@"$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb" -k -i "$(ICUBLD_PKG)" -d"$(ICUBLD_PKG)\$(ICURBNF)" $<
$(ICURBNF)\res_index.res:
@echo Generating <<$(ICURBNF)\res_index.txt
@ -965,7 +998,7 @@ res_index:table(nofallback) {
}
}
<<KEEP
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" -k -d"$(ICUBLD_PKG)\$(ICURBNF)" .\$(ICURBNF)\res_index.txt
@"$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb" -k -d"$(ICUBLD_PKG)\$(ICURBNF)" .\$(ICURBNF)\res_index.txt
$(ICUBRK)\res_index.res:
@echo Generating <<$(ICUBRK)\res_index.txt
@ -977,15 +1010,15 @@ res_index:table(nofallback) {
}
}
<<KEEP
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" -k -d"$(ICUBLD_PKG)\$(ICUBRK)" .\$(ICUBRK)\res_index.txt
@"$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb" -k -d"$(ICUBLD_PKG)\$(ICUBRK)" .\$(ICUBRK)\res_index.txt
{$(ICUSRCDATA_RELATIVE_PATH)\$(ICUBRK)}.txt{$(ICUBRK)}.res::
@echo Making Break Iterator Resource files
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" -k -i "$(ICUBLD_PKG)" -d"$(ICUBLD_PKG)\$(ICUBRK)" $<
@"$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb" -k -i "$(ICUBLD_PKG)" -d"$(ICUBLD_PKG)\$(ICUBRK)" $<
{$(ICUSRCDATA_RELATIVE_PATH)\$(ICUTRNS)}.txt{$(ICUTRNS)}.res::
@echo Making Transliterator files
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" -k -i "$(ICUBLD_PKG)" -d"$(ICUBLD_PKG)\$(ICUTRNS)" $<
@"$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb" -k -i "$(ICUBLD_PKG)" -d"$(ICUBLD_PKG)\$(ICUTRNS)" $<
# DLL version information
@ -995,9 +1028,9 @@ res_index:table(nofallback) {
@rc.exe /i "..\..\..\..\common" /r /fo $@ $**
# Targets for converters
"$(ICUBLD_PKG)\cnvalias.icu" : {"$(ICUSRCDATA)\$(ICUUCM)"}\convrtrs.txt "$(ICUTOOLS)\gencnval\$(CFG)\gencnval.exe"
"$(ICUBLD_PKG)\cnvalias.icu" : {"$(ICUSRCDATA)\$(ICUUCM)"}\convrtrs.txt "$(ICUTOOLS)\gencnval\$(CFGTOOLS)\gencnval.exe"
@echo Creating data file for Converter Aliases
@"$(ICUTOOLS)\gencnval\$(CFG)\gencnval" -d "$(ICUBLD_PKG)" "$(ICUSRCDATA)\$(ICUUCM)\convrtrs.txt"
@"$(ICUTOOLS)\gencnval\$(CFGTOOLS)\gencnval" -d "$(ICUBLD_PKG)" "$(ICUSRCDATA)\$(ICUUCM)\convrtrs.txt"
# Targets for prebuilt Unicode data
"$(ICUBLD_PKG)\pnames.icu": $(ICUSRCDATA_RELATIVE_PATH)\in\pnames.icu
@ -1033,32 +1066,32 @@ res_index:table(nofallback) {
# Stringprep .spp file generation.
{$(ICUSRCDATA_RELATIVE_PATH)\$(ICUSPREP)}.txt.spp:
@echo Creating $@
@"$(ICUTOOLS)\gensprep\$(CFG)\gensprep" -s $(<D) -d "$(ICUBLD_PKG)" -b $(@B) -m "$(ICUUNIDATA)" -u 3.2.0 $(<F)
@"$(ICUTOOLS)\gensprep\$(CFGTOOLS)\gensprep" -s $(<D) -d "$(ICUBLD_PKG)" -b $(@B) -m "$(ICUUNIDATA)" -u 3.2.0 $(<F)
# Confusables .cfu file generation
# Can't use an inference rule because two .txt source files combine to produce a single .cfu output file
"$(ICUBLD_PKG)\confusables.cfu": "$(ICUUNIDATA)\confusables.txt" "$(ICUUNIDATA)\confusablesWholeScript.txt" "$(ICUTOOLS)\gencfu\$(CFG)\gencfu.exe"
"$(ICUBLD_PKG)\confusables.cfu": "$(ICUUNIDATA)\confusables.txt" "$(ICUUNIDATA)\confusablesWholeScript.txt" "$(ICUTOOLS)\gencfu\$(CFGTOOLS)\gencfu.exe"
@echo Creating $@
@"$(ICUTOOLS)\gencfu\$(CFG)\gencfu" -c -r "$(ICUUNIDATA)\confusables.txt" -w "$(ICUUNIDATA)\confusablesWholeScript.txt" -o $@ -i "$(ICUBLD_PKG)"
@"$(ICUTOOLS)\gencfu\$(CFGTOOLS)\gencfu" -c -r "$(ICUUNIDATA)\confusables.txt" -w "$(ICUUNIDATA)\confusablesWholeScript.txt" -o $@ -i "$(ICUBLD_PKG)"
!IFDEF ICUDATA_ARCHIVE
"$(ICUDATA_SOURCE_ARCHIVE)": CREATE_DIRS $(ICUDATA_ARCHIVE) "$(ICUTOOLS)\icupkg\$(CFG)\icupkg.exe"
"$(ICUTOOLS)\icupkg\$(CFG)\icupkg" -t$(U_ICUDATA_ENDIAN_SUFFIX) "$(ICUDATA_ARCHIVE)" "$(ICUDATA_SOURCE_ARCHIVE)"
"$(ICUDATA_SOURCE_ARCHIVE)": CREATE_DIRS $(ICUDATA_ARCHIVE) "$(ICUTOOLS)\icupkg\$(CFGTOOLS)\icupkg.exe"
"$(ICUTOOLS)\icupkg\$(CFGTOOLS)\icupkg" -t$(U_ICUDATA_ENDIAN_SUFFIX) "$(ICUDATA_ARCHIVE)" "$(ICUDATA_SOURCE_ARCHIVE)"
!ENDIF
# Dependencies on the tools for the batch inference rules
!IFNDEF ICUDATA_SOURCE_ARCHIVE
$(UCM_SOURCE) : {"$(ICUTOOLS)\makeconv\$(CFG)"}makeconv.exe
$(UCM_SOURCE) : {"$(ICUTOOLS)\makeconv\$(CFGTOOLS)"}makeconv.exe
!IFDEF BUILD_SPECIAL_CNV_FILES
$(UCM_SOURCE_SPECIAL): {"$(ICUTOOLS)\makeconv\$(CFG)"}makeconv.exe
$(UCM_SOURCE_SPECIAL): {"$(ICUTOOLS)\makeconv\$(CFGTOOLS)"}makeconv.exe
!ENDIF
# This used to depend on "$(ICUBLD_PKG)\uprops.icu" "$(ICUBLD_PKG)\ucase.icu" "$(ICUBLD_PKG)\ubidi.icu"
# This data is now hard coded as a part of the library.
# See Jitterbug 4497 for details.
$(MISC_SOURCE) $(RB_FILES) $(CURR_FILES) $(LANG_FILES) $(REGION_FILES) $(ZONE_FILES) $(UNIT_FILES) $(COL_COL_FILES) $(RBNF_RES_FILES) $(BRK_RES_FILES) $(TRANSLIT_RES_FILES): {"$(ICUTOOLS)\genrb\$(CFG)"}genrb.exe "$(ICUBLD_PKG)\$(ICUCOL)\ucadata.icu"
$(MISC_SOURCE) $(RB_FILES) $(CURR_FILES) $(LANG_FILES) $(REGION_FILES) $(ZONE_FILES) $(UNIT_FILES) $(COL_COL_FILES) $(RBNF_RES_FILES) $(BRK_RES_FILES) $(TRANSLIT_RES_FILES): {"$(ICUTOOLS)\genrb\$(CFGTOOLS)"}genrb.exe "$(ICUBLD_PKG)\$(ICUCOL)\ucadata.icu"
# This used to depend on "$(ICUBLD_PKG)\pnames.icu" "$(ICUBLD_PKG)\uprops.icu" "$(ICUBLD_PKG)\ucase.icu" "$(ICUBLD_PKG)\ubidi.icu"
# These are now hardcoded in ICU4C and only loaded in ICU4J.

View file

@ -36,8 +36,8 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\x86\Release\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\x86\Release\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\data\tmp\x86\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\data\build\</IntDir>
<NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Release</NMakeBuildCommandLine>
<NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Release clean all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Release clean</NMakeCleanCommandLine>
@ -47,8 +47,8 @@
<NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
<NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
<NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\x86\Debug\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\x86\Debug\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\data\tmp\x86\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\data\build\</IntDir>
<NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Debug</NMakeBuildCommandLine>
<NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Debug clean all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Debug clean</NMakeCleanCommandLine>
@ -58,8 +58,8 @@
<NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
<NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
<NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\x64\Release\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\x64\Release\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\data\tmp\x64\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\data\build\</IntDir>
<NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Release</NMakeBuildCommandLine>
<NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Release clean all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Release clean</NMakeCleanCommandLine>
@ -69,8 +69,8 @@
<NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
<NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
<NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\x64\Debug\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\x64\Debug\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\data\tmp\x64\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\data\build\</IntDir>
<NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Debug</NMakeBuildCommandLine>
<NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Debug clean all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Debug clean</NMakeCleanCommandLine>
@ -216,4 +216,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View file

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Arm">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B1D53358-37BD-48BC-B27C-68BAF1E78508}</ProjectGuid>
<Keyword>MakeFileProj</Keyword>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<WindowsTargetPlatformVersion>10.0.10586.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
<ConfigurationType>Makefile</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\data\tmp\x86\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\data\tmp\x86\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\data\tmp\x64\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\data\tmp\x64\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">.\data\tmp\arm\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">.\data\tmp\arm\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\data\build\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\data\build\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\data\build\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\data\build\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">.\data\build\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">.\data\build\</IntDir>
<NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Release UWP=UWP</NMakeBuildCommandLine>
<NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Release UWP=UWP clean all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Release UWP=UWP clean</NMakeCleanCommandLine>
<NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Debug UWP=UWP</NMakeBuildCommandLine>
<NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Debug UWP=UWP clean all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x86\Debug UWP=UWP clean</NMakeCleanCommandLine>
<NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Release UWP=UWP</NMakeBuildCommandLine>
<NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Release UWP=UWP clean all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Release UWP=UWP clean</NMakeCleanCommandLine>
<NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Debug UWP=UWP</NMakeBuildCommandLine>
<NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Debug UWP=UWP clean all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=x64\Debug UWP=UWP clean</NMakeCleanCommandLine>
<NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=ARM\Release UWP=UWP</NMakeBuildCommandLine>
<NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=ARM\Release UWP=UWP clean all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=ARM\Release UWP=UWP clean</NMakeCleanCommandLine>
<NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=ARM\Debug UWP=UWP</NMakeBuildCommandLine>
<NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=ARM\Debug UWP=UWP clean all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NMAKE /f makedata.mak ICUMAKE="$(ProjectDir)\" CFG=ARM\Debug UWP=UWP clean</NMakeCleanCommandLine>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<BuildLog>
<Path>.\out\tmp\x86\ReleaseUWPBuildLog.html</Path>
</BuildLog>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<BuildLog>
<Path>.\out\tmp\x86\DebugUWPBuildLog.html</Path>
</BuildLog>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<BuildLog>
<Path>.\out\tmp\x64\ReleaseUWPBuildLog.html</Path>
</BuildLog>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<BuildLog>
<Path>.\out\tmp\x64\DebugUWPBuildLog.html</Path>
</BuildLog>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<BuildLog>
<Path>.\out\tmp\arm\ReleaseUWPBuildLog.html</Path>
</BuildLog>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<BuildLog>
<Path>.\out\tmp\arm\DebugUWPBuildLog.html</Path>
</BuildLog>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="brkitr\brkfiles.mk" />
<None Include="coll\colfiles.mk" />
<None Include="makedata.mak" />
<None Include="misc\miscfiles.mk" />
<None Include="rbnf\rbnffiles.mk" />
<None Include="locales\resfiles.mk" />
<None Include="..\test\testdata\testdata.mak" />
<None Include="translit\trnsfiles.mk" />
<None Include="..\test\testdata\tstfiles.mk" />
<None Include="mappings\ucmcore.mk" />
<None Include="mappings\ucmebcdic.mk" />
<None Include="mappings\ucmfiles.mk" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include=".\makedata.vcxproj">
<Project>{D9DF7F2F-93B7-4810-B5CD-96F4F33C079B}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

File diff suppressed because it is too large Load diff

View file

@ -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<wchar_t>(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<const wchar_t*>(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<const wchar_t*>(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);
}
}

View file

@ -95,7 +95,7 @@ public:
* <pre>
* . Base* polymorphic_pointer = createPolymorphicObject();
* . if (polymorphic_pointer->getDynamicClassID() ==
* . erived::getStaticClassID()) ...
* . derived::getStaticClassID()) ...
* </pre>
* @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

View file

@ -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<wchar_t>(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<const wchar_t*>(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<const wchar_t*>(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<const wchar_t*>(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);
}
}
}

View file

@ -128,7 +128,7 @@ public:
* <pre>
* . Base* polymorphic_pointer = createPolymorphicObject();
* . if (polymorphic_pointer->getDynamicClassID() ==
* . erived::getStaticClassID()) ...
* . derived::getStaticClassID()) ...
* </pre>
* @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

View file

@ -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

View file

@ -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;

View file

@ -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);

View file

@ -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;