From 5ac0889b40fb2fce465fc847652ef334ab49dfd1 Mon Sep 17 00:00:00 2001 From: GoldenCrystal Date: Sun, 2 Nov 2014 22:29:56 +0100 Subject: [PATCH] =?UTF-8?q?For=20now,=20assign=20the=20unicode=20label=20a?= =?UTF-8?q?s=20a=20code=20point=20in=20the=20data=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UnicodeInformation/UnicodeCharacterRange.cs | 2 ++ UnicodeInformation/UnicodeDataManager.cs | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/UnicodeInformation/UnicodeCharacterRange.cs b/UnicodeInformation/UnicodeCharacterRange.cs index dba9ad5..85ee2ae 100644 --- a/UnicodeInformation/UnicodeCharacterRange.cs +++ b/UnicodeInformation/UnicodeCharacterRange.cs @@ -37,6 +37,8 @@ namespace UnicodeInformation public readonly int FirstCodePoint; public readonly int LastCodePoint; + public bool IsSingleCodePoint { get { return FirstCodePoint == LastCodePoint; } } + public UnicodeCharacterRange(int codePoint) { if (codePoint < 0 || codePoint > 0x10FFFF) throw new ArgumentOutOfRangeException("codePoint"); diff --git a/UnicodeInformation/UnicodeDataManager.cs b/UnicodeInformation/UnicodeDataManager.cs index 4ddc433..e331d9d 100644 --- a/UnicodeInformation/UnicodeDataManager.cs +++ b/UnicodeInformation/UnicodeDataManager.cs @@ -58,7 +58,13 @@ namespace UnicodeInformation name = name.Substring(1, name.Length - 8); rangeStartCodePoint = -1; - } + } + else + { + name = name.Substring(1, name.Length - 2); + + if (codePoint.IsSingleCodePoint) name = name + "-" + codePoint.ToString(); + } } else if (rangeStartCodePoint >= 0) {