Upgrade for Unicode Version 8.0.0.

This commit is contained in:
GoldenCrystal
2015-07-19 01:56:28 +02:00
parent a429d83bdb
commit 07b4086423
3 changed files with 6 additions and 6 deletions
@@ -286,16 +286,16 @@ namespace System.Unicode.Builder
{
using (var writer = new BinaryWriter(stream, Encoding.UTF8, true))
{
writer.Write(new byte[] { (byte)'U', (byte)'C', (byte)'D', 1 });
writer.Write((ushort)7); // Hardcode Unicode 7.0
writer.Write(new byte[] { (byte)'U', (byte)'C', (byte)'D', 2 });
writer.Write((ushort)8); // Hardcode Unicode 8.0
writer.Write((byte)0);
writer.WriteCodePoint(ucdEntryCount);
for (int i = 0; i < ucdEntryCount; ++i)
{
ucdEntries[i].WriteToFile(writer);
}
if (blockEntries.Count > 255) throw new InvalidOperationException("There are too many block entries. The file format needs to be upgraded.");
writer.Write((byte)blockEntries.Count);
if (blockEntries.Count > ushort.MaxValue) throw new InvalidOperationException("There are too many block entries. The file format needs to be upgraded.");
writer.Write((ushort)blockEntries.Count);
for (int i = 0; i < blockEntries.Count; ++i)
{
WriteUnicodeBlockToFile(writer, blockEntries[i]);
+2 -2
View File
@@ -44,7 +44,7 @@ namespace System.Unicode
byte formatVersion = reader.ReadByte();
if (formatVersion != 1) throw new InvalidDataException();
if (formatVersion != 2) throw new InvalidDataException();
var fileUnicodeVersion = new Version(reader.ReadUInt16(), reader.ReadByte());
@@ -69,7 +69,7 @@ namespace System.Unicode
unicodeCharacterDataEntries[i] = ReadUnicodeCharacterDataEntry(reader, nameBuffer);
}
var blockEntries = new UnicodeBlock[reader.ReadByte()];
var blockEntries = new UnicodeBlock[reader.ReadUInt16()];
for (i = 0; i < blockEntries.Length; ++i)
{
Binary file not shown.