From a1c34a4637a017b54e79a3eaea3728d3f3c4399b Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 16 Oct 2018 15:27:44 -0400 Subject: [PATCH] emoji: update spec for combination unicode Signed-off-by: Vincent Batts --- README.md | 2 +- emoji/README.md | 13 ++++++++++++- emoji/emojimap.json | 2 +- emoji/list.md | 2 +- emoji/map_gen.go | 2 +- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 06ce7da..a2e4bd7 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ import ( func main() { for i := 0; i < 255; i++ { - fmt.Printf("%d :\n", i) + fmt.Printf("%d (%2.2x):\n", i, i) for _, word := range emoji.Map(byte(i)) { fmt.Printf(" - %s\n", emoji.CodepointToUnicode(word)) } diff --git a/emoji/README.md b/emoji/README.md index 194fe84..6e6f018 100644 --- a/emoji/README.md +++ b/emoji/README.md @@ -50,7 +50,7 @@ The purpose of this practice is provide simplified way to convey [checksums](htt ### Intended Audience -This is intended for use by implementors of software to convey checksums or validate conveyed checksums. +This is intended for use by implementors of software to convey checksums or validate conveyed checksums or unique fingerprints. ## Details @@ -60,6 +60,17 @@ Most checksums convey in a hexadecimal notation, there showing a par of case-ins Having a mapping of 256 emojis this thereby reduces the number of characters (or emojis) needed to convey the checksum. In example, a [SHA1](https://en.wikipedia.org/wiki/SHA-1) checksum is 40 hexadecimal characters long, whereas an SHA1-emojisum is only 20 emojis. +### The emojimap + +In the common document [`emojimap.json`](./emojimap.json) there is an ordered list of arrays. +Each array contains a set of strings that are either a human readable word or the human readable unicode point. +For example, byte `0xe8` (position 232) is `[":nauseated_face:", "U+1F922"]`. + +For more complex and visually similar emoji there are times that the unicode is a combination. +This is the case for flags and people. +For example, byte `0xd9` (position 217) includes `:surfer:`, `U+1F3C4`, and `U+1F3C4U+200DU+2642U+FEOF`. +When there is a combination, implementations MUST split on the "`U+`". + ## References * Unicode Technical Report #51 - http://www.unicode.org/reports/tr51/ diff --git a/emoji/emojimap.json b/emoji/emojimap.json index dd98e80..5c9041e 100644 --- a/emoji/emojimap.json +++ b/emoji/emojimap.json @@ -1,5 +1,5 @@ { - "version": "draft+2", + "version": "draft+3", "description": "This ordered list of emojiwords is the conventional order for the practice of conveying checksums with emoji. Each position provides the alternative for resolving the desired emoji.", "emojiwords": [ [":+1:", "U+1F44D"], diff --git a/emoji/list.md b/emoji/list.md index b0bb9cc..ab2ddea 100644 --- a/emoji/list.md +++ b/emoji/list.md @@ -12,7 +12,7 @@ This ordered list of emojiwords is the conventional order for the practice of co ### Version -draft+2 +draft+3 ### List * `0` -- :+1: `:+1:` [U+1F44D](http://www.unicode.org/emoji/charts/full-emoji-list.html#1F44D) diff --git a/emoji/map_gen.go b/emoji/map_gen.go index 9ea5b15..2a0cbf3 100644 --- a/emoji/map_gen.go +++ b/emoji/map_gen.go @@ -6,7 +6,7 @@ package emoji func init() { mapGen = VersionedMap{ Description: "This ordered list of emojiwords is the conventional order for the practice of conveying checksums with emoji. Each position provides the alternative for resolving the desired emoji.", - Version: "draft+2", + Version: "draft+3", EmojiWords: []Words{ Words{ ":+1:","U+1F44D", },