Upgrade for Unicode Version 8.0.0.
This commit is contained in:
@@ -286,16 +286,16 @@ namespace System.Unicode.Builder
|
|||||||
{
|
{
|
||||||
using (var writer = new BinaryWriter(stream, Encoding.UTF8, true))
|
using (var writer = new BinaryWriter(stream, Encoding.UTF8, true))
|
||||||
{
|
{
|
||||||
writer.Write(new byte[] { (byte)'U', (byte)'C', (byte)'D', 1 });
|
writer.Write(new byte[] { (byte)'U', (byte)'C', (byte)'D', 2 });
|
||||||
writer.Write((ushort)7); // Hardcode Unicode 7.0
|
writer.Write((ushort)8); // Hardcode Unicode 8.0
|
||||||
writer.Write((byte)0);
|
writer.Write((byte)0);
|
||||||
writer.WriteCodePoint(ucdEntryCount);
|
writer.WriteCodePoint(ucdEntryCount);
|
||||||
for (int i = 0; i < ucdEntryCount; ++i)
|
for (int i = 0; i < ucdEntryCount; ++i)
|
||||||
{
|
{
|
||||||
ucdEntries[i].WriteToFile(writer);
|
ucdEntries[i].WriteToFile(writer);
|
||||||
}
|
}
|
||||||
if (blockEntries.Count > 255) throw new InvalidOperationException("There are too many block entries. The file format needs to be upgraded.");
|
if (blockEntries.Count > ushort.MaxValue) throw new InvalidOperationException("There are too many block entries. The file format needs to be upgraded.");
|
||||||
writer.Write((byte)blockEntries.Count);
|
writer.Write((ushort)blockEntries.Count);
|
||||||
for (int i = 0; i < blockEntries.Count; ++i)
|
for (int i = 0; i < blockEntries.Count; ++i)
|
||||||
{
|
{
|
||||||
WriteUnicodeBlockToFile(writer, blockEntries[i]);
|
WriteUnicodeBlockToFile(writer, blockEntries[i]);
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace System.Unicode
|
|||||||
|
|
||||||
byte formatVersion = reader.ReadByte();
|
byte formatVersion = reader.ReadByte();
|
||||||
|
|
||||||
if (formatVersion != 1) throw new InvalidDataException();
|
if (formatVersion != 2) throw new InvalidDataException();
|
||||||
|
|
||||||
var fileUnicodeVersion = new Version(reader.ReadUInt16(), reader.ReadByte());
|
var fileUnicodeVersion = new Version(reader.ReadUInt16(), reader.ReadByte());
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ namespace System.Unicode
|
|||||||
unicodeCharacterDataEntries[i] = ReadUnicodeCharacterDataEntry(reader, nameBuffer);
|
unicodeCharacterDataEntries[i] = ReadUnicodeCharacterDataEntry(reader, nameBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
var blockEntries = new UnicodeBlock[reader.ReadByte()];
|
var blockEntries = new UnicodeBlock[reader.ReadUInt16()];
|
||||||
|
|
||||||
for (i = 0; i < blockEntries.Length; ++i)
|
for (i = 0; i < blockEntries.Length; ++i)
|
||||||
{
|
{
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user