diff --git a/Common.props b/Common.props new file mode 100644 index 0000000..de91010 --- /dev/null +++ b/Common.props @@ -0,0 +1,9 @@ + + + .NET Unicode Information + Fabien Barbier + Copyright © Fabien Barbier 2014-2017 + en + 2.1.0 + + \ No newline at end of file diff --git a/UnicodeInformation.Builder/App.config b/UnicodeInformation.Builder/App.config deleted file mode 100644 index 8e15646..0000000 --- a/UnicodeInformation.Builder/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/UnicodeInformation.Builder/Program.cs b/UnicodeInformation.Builder/Program.cs index 392a2db..a60bed1 100644 --- a/UnicodeInformation.Builder/Program.cs +++ b/UnicodeInformation.Builder/Program.cs @@ -53,7 +53,7 @@ namespace System.Unicode.Builder internal static IDataSource GetDataSource(string archiveName, string directoryName, string[] requiredFiles, bool? shouldDownload, bool? shouldSaveArchive, bool? shouldExtract) { - string baseDirectory = Environment.CurrentDirectory; + string baseDirectory = Directory.GetCurrentDirectory(); string dataDirectory = Path.Combine(baseDirectory, UcdDirectoryName); string dataArchiveFileName = Path.Combine(baseDirectory, archiveName); diff --git a/UnicodeInformation.Builder/Properties/AssemblyInfo.cs b/UnicodeInformation.Builder/Properties/AssemblyInfo.cs index 26bc081..acf503c 100644 --- a/UnicodeInformation.Builder/Properties/AssemblyInfo.cs +++ b/UnicodeInformation.Builder/Properties/AssemblyInfo.cs @@ -1,8 +1,3 @@ -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; -[assembly: AssemblyTitle("UnicodeInformation.Builder")] -[assembly: AssemblyDescription("Data file builder for the .NET Unicode Information Library.")] -[assembly: NeutralResourcesLanguage("en")] [assembly: InternalsVisibleTo("UnicodeInformation.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100711da5e71bb2208797ed36597e628c6bf6541b6c157ede943539d19de5104763bd2f42d8c0233ea8fbe7e782d4e2d29c3706a8e8dc1cfa78faabec946a167f7b2b1d396d17a85839ad96f2be930c0efaa893c8b9b6a665bf50ca569b56b9eabf3a69e8274723f85e9d4c3eea1e53dcbbb29a74c78c305e447917daaa6593f1c2")] \ No newline at end of file diff --git a/UnicodeInformation.Builder/UnicodeDataFileReader.cs b/UnicodeInformation.Builder/UnicodeDataFileReader.cs index d60afb5..bd050e6 100644 --- a/UnicodeInformation.Builder/UnicodeDataFileReader.cs +++ b/UnicodeInformation.Builder/UnicodeDataFileReader.cs @@ -72,7 +72,7 @@ namespace System.Unicode.Builder { if (byteBuffer[index++] == '\n') { - if (index < length && !IsNewLineOrComment(byteBuffer[index])) + if ((index < length || RefillBuffer()) && !IsNewLineOrComment(byteBuffer[index])) { hasField = true; goto Completed; diff --git a/UnicodeInformation.Builder/UnicodeDataProcessor.cs b/UnicodeInformation.Builder/UnicodeDataProcessor.cs index c79296f..77fa19b 100644 --- a/UnicodeInformation.Builder/UnicodeDataProcessor.cs +++ b/UnicodeInformation.Builder/UnicodeDataProcessor.cs @@ -128,8 +128,7 @@ namespace System.Unicode.Builder CanonicalCombiningClass = (CanonicalCombiningClass)byte.Parse(reader.ReadField()), }; - BidirectionalClass bidirectionalClass; - if (EnumHelper.TryGetNamedValue(reader.ReadField(), out bidirectionalClass)) + if (EnumHelper.TryGetNamedValue(reader.ReadField(), out var bidirectionalClass)) { characterData.BidirectionalClass = bidirectionalClass; } @@ -196,10 +195,8 @@ namespace System.Unicode.Builder { while (reader.MoveToNextLine()) { - ContributoryProperties property; - var range = UnicodeCodePointRange.Parse(reader.ReadTrimmedField()); - if (EnumHelper.TryGetNamedValue(reader.ReadTrimmedField(), out property)) + if (EnumHelper.TryGetNamedValue(reader.ReadTrimmedField(), out var property)) { builder.SetProperties(property, range); } @@ -213,10 +210,8 @@ namespace System.Unicode.Builder { while (reader.MoveToNextLine()) { - CoreProperties property; - var range = UnicodeCodePointRange.Parse(reader.ReadTrimmedField()); - if (EnumHelper.TryGetNamedValue(reader.ReadTrimmedField(), out property)) + if (EnumHelper.TryGetNamedValue(reader.ReadTrimmedField(), out var property)) { builder.SetProperties(property, range); } @@ -281,9 +276,8 @@ namespace System.Unicode.Builder string name = reader.ReadField(); string kindName = reader.ReadField(); - UnicodeNameAliasKind kind; - if (!EnumHelper.TryGetNamedValue(kindName, out kind)) + if (!EnumHelper.TryGetNamedValue(kindName, out var kind)) throw new InvalidDataException("Unrecognized name alias: " + kindName + ".3"); ucd.NameAliases.Add(new UnicodeNameAlias(name, kind)); diff --git a/UnicodeInformation.Builder/UnicodeInfoBuilder.cs b/UnicodeInformation.Builder/UnicodeInfoBuilder.cs index 6efd819..452c93f 100644 --- a/UnicodeInformation.Builder/UnicodeInfoBuilder.cs +++ b/UnicodeInformation.Builder/UnicodeInfoBuilder.cs @@ -195,7 +195,7 @@ namespace System.Unicode.Builder || ucdEntries[firstIndex].CodePointRange.FirstCodePoint < codePointRange.FirstCodePoint || ucdEntries[lastIndex].CodePointRange.LastCodePoint > codePointRange.LastCodePoint) { - throw new InvalidOperationException(); + throw new InvalidOperationException("Unable to find code point for setting contributory property."); } int i = firstIndex; diff --git a/UnicodeInformation.Builder/UnicodeInformation.Builder.csproj b/UnicodeInformation.Builder/UnicodeInformation.Builder.csproj index 9664af3..edfb906 100644 --- a/UnicodeInformation.Builder/UnicodeInformation.Builder.csproj +++ b/UnicodeInformation.Builder/UnicodeInformation.Builder.csproj @@ -1,94 +1,18 @@ - - - + + - Release - AnyCPU - {8DFDEE6C-4F0D-4DE1-B346-574CB56D2B8B} Exe - Properties - System.Unicode.Builder - UnicodeInformation.Builder - v4.5 - 512 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - - + netcoreapp1.1 + True true - - ..\System.Unicode.snk + UnicodeInformation.Builder + Data file builder for the .NET Unicode Information Library. - - - - - - - - - - - - - - - Properties\AssemblyInfo.Common.cs - - - - - True - True - UnihanProperty.tt - - - - - - - - - - - - - - - - - System.Unicode.snk - - - - - {cb722958-a1c4-4121-804b-7d5a671491b1} - UnicodeInformation - @@ -96,15 +20,10 @@ UnihanProperty.cs + + + - - \ No newline at end of file diff --git a/UnicodeInformation.Builder/ucd.dat b/UnicodeInformation.Builder/ucd.dat new file mode 100644 index 0000000..e788c4f Binary files /dev/null and b/UnicodeInformation.Builder/ucd.dat differ diff --git a/UnicodeInformation.Tests/Properties/AssemblyInfo.cs b/UnicodeInformation.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index cf66714..0000000 --- a/UnicodeInformation.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System.Reflection; -using System.Resources; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("UnicodeInformation.Tests")] -[assembly: AssemblyDescription("")] -[assembly: NeutralResourcesLanguage("en")] -[assembly: Guid("50337426-e884-4394-9e1a-f6f7a555f5d9")] diff --git a/UnicodeInformation.Tests/UnicodeInfoTests.cs b/UnicodeInformation.Tests/UnicodeInfoTests.cs index e46b4bb..8621f62 100644 --- a/UnicodeInformation.Tests/UnicodeInfoTests.cs +++ b/UnicodeInformation.Tests/UnicodeInfoTests.cs @@ -10,7 +10,7 @@ namespace UnicodeInformation.Tests [Fact] public void UnicodeVersionShouldBeTheLatestSupported() { - Assert.Equal(new Version(9, 0, 0), UnicodeInfo.UnicodeVersion); + Assert.Equal(new Version(10, 0, 0), UnicodeInfo.UnicodeVersion); } [Fact] diff --git a/UnicodeInformation.Tests/UnicodeInformation.Tests.csproj b/UnicodeInformation.Tests/UnicodeInformation.Tests.csproj index 9f27439..afa3597 100644 --- a/UnicodeInformation.Tests/UnicodeInformation.Tests.csproj +++ b/UnicodeInformation.Tests/UnicodeInformation.Tests.csproj @@ -1,116 +1,26 @@ - - - - - - - Release - AnyCPU - {50337426-E884-4394-9E1A-F6F7A555F5D9} - Library - Properties - UnicodeInformation.Tests - UnicodeInformation.Tests - v4.5 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - + + + netcoreapp1.1 true - - ..\System.Unicode.snk + - - - - - - - - ..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll - True - - - ..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll - True - - - ..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll - True - - - ..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll - True - - - - - Properties\AssemblyInfo.Common.cs - - - - - - - - - - - - - {8dfdee6c-4f0d-4de1-b346-574cb56d2b8b} - UnicodeInformation.Builder - - - {cb722958-a1c4-4121-804b-7d5a671491b1} - UnicodeInformation - - System.Unicode.snk - - + + + + + + + + + + - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - \ No newline at end of file diff --git a/UnicodeInformation.sln b/UnicodeInformation.sln index e89bdee..5ad8ee7 100644 --- a/UnicodeInformation.sln +++ b/UnicodeInformation.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.22310.1 +# Visual Studio 15 +VisualStudioVersion = 15.0.26430.13 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnicodeCharacterInspector", "UnicodeCharacterInspector\UnicodeCharacterInspector.csproj", "{04E97F21-EF04-441F-83CF-2E71F3AAB089}" EndProject @@ -15,11 +15,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ProjectSection(SolutionItems) = preProject appveyor.yml = appveyor.yml AssemblyInfo.Common.cs = AssemblyInfo.Common.cs + Common.props = Common.props Example.cs = Example.cs LICENSE.txt = LICENSE.txt README.md = README.md System.Unicode.snk = System.Unicode.snk - UnicodeInformation\UnicodeInformation.nuspec = UnicodeInformation\UnicodeInformation.nuspec EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{311FC325-8547-4806-8617-956F1356A92C}" diff --git a/UnicodeInformation/Properties/AssemblyInfo.cs b/UnicodeInformation/Properties/AssemblyInfo.cs index 8cabf1e..cbff86d 100644 --- a/UnicodeInformation/Properties/AssemblyInfo.cs +++ b/UnicodeInformation/Properties/AssemblyInfo.cs @@ -1,10 +1,5 @@ -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; -[assembly: AssemblyTitle(".NET Unicode Information Library")] -[assembly: AssemblyDescription("Library providing access to Unicode data to .NET clients.")] -[assembly: NeutralResourcesLanguage("en")] [assembly: InternalsVisibleTo("UnicodeInformation.Builder, PublicKey=0024000004800000940000000602000000240000525341310004000001000100711da5e71bb2208797ed36597e628c6bf6541b6c157ede943539d19de5104763bd2f42d8c0233ea8fbe7e782d4e2d29c3706a8e8dc1cfa78faabec946a167f7b2b1d396d17a85839ad96f2be930c0efaa893c8b9b6a665bf50ca569b56b9eabf3a69e8274723f85e9d4c3eea1e53dcbbb29a74c78c305e447917daaa6593f1c2")] #if DEBUG [assembly: InternalsVisibleTo("UnicodeInformation.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100711da5e71bb2208797ed36597e628c6bf6541b6c157ede943539d19de5104763bd2f42d8c0233ea8fbe7e782d4e2d29c3706a8e8dc1cfa78faabec946a167f7b2b1d396d17a85839ad96f2be930c0efaa893c8b9b6a665bf50ca569b56b9eabf3a69e8274723f85e9d4c3eea1e53dcbbb29a74c78c305e447917daaa6593f1c2")] diff --git a/UnicodeInformation/UnicodeInformation.csproj b/UnicodeInformation/UnicodeInformation.csproj index d314370..0f63cae 100644 --- a/UnicodeInformation/UnicodeInformation.csproj +++ b/UnicodeInformation/UnicodeInformation.csproj @@ -1,110 +1,37 @@ - - - + + - 11.0 - Release - AnyCPU - {CB722958-A1C4-4121-804B-7D5A671491B1} - Library - Properties + netstandard1.1 System.Unicode - UnicodeInformation en-US - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} bin\$(Configuration)\$(AssemblyName).xml - Profile7 - v4.5 - <_WindowsKitBinPath>C:\Program Files (x86)\Windows Kits\8.1\bin\x86 - <_WindowsPhoneKitBinPath>C:\Program Files (x86)\Windows Phone Kits\8.1\bin - $(_WindowsKitBinPath)\makepri.exe - $(_WindowsKitBinPath)\makeappx.exe - $(_WindowsKitBinPath)\signtool.exe - $(_WindowsPhoneKitBinPath)\x86\MrmEnvironmentExtDl.dll - $(_WindowsPhoneKitBinPath)\x64\MrmEnvironmentExtDl.dll - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - true - - ..\System.Unicode.snk + .NET Unicode Information Library + Library providing access to Unicode data to .NET clients. + http://opensource.org/licenses/MIT + https://github.com/GoldenCrystal/NetUnicodeInfo + https://raw.githubusercontent.com/GoldenCrystal/NetUnicodeInfo/master/UnicodeCharacterInspector/UnicodeCharacterInspector.ico + Version 2.1 +------------- +Support for Unicode 10.0. + +Version 2.0 +------------- +Following migration to Unicode 9.0.0, UnicodeRadicalStrokeCount.StrokeCount is now of type System.SByte instead of type System.Byte. + Unicode Unihan Data .NET C# String Text Char Character CodePoint Code Point + True - - - System.Unicode.snk - - + ucd.dat - + + System.Unicode.snk + - - Properties\AssemblyInfo.Common.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - \ No newline at end of file diff --git a/UnicodeInformation/UnicodeInformation.nuspec b/UnicodeInformation/UnicodeInformation.nuspec deleted file mode 100644 index b508c35..0000000 --- a/UnicodeInformation/UnicodeInformation.nuspec +++ /dev/null @@ -1,22 +0,0 @@ - - - - $id$ - $version$ - $title$ - $author$ - $author$ - http://opensource.org/licenses/MIT - https://github.com/GoldenCrystal/NetUnicodeInfo - https://raw.githubusercontent.com/GoldenCrystal/NetUnicodeInfo/master/UnicodeCharacterInspector/UnicodeCharacterInspector.ico - false - $description$ - - Version 2.0 - ------------- - Following migration to Unicode 9.0.0, UnicodeRadicalStrokeCount.StrokeCount is now of type System.SByte instead of type System.Byte. - - Copyright 2014 - Unicode Unihan Data .NET C# String Text Char Character CodePoint Code Point - - \ No newline at end of file diff --git a/UnicodeInformation/app.config b/UnicodeInformation/app.config deleted file mode 100644 index 108b695..0000000 --- a/UnicodeInformation/app.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/UnicodeInformation/ucd.dat b/UnicodeInformation/ucd.dat index 052d884..e788c4f 100644 Binary files a/UnicodeInformation/ucd.dat and b/UnicodeInformation/ucd.dat differ