Skip to content
Snippets Groups Projects

Update support for Unicode 15.1

Merged Brett Walker requested to merge 28-update-support-for-unicode-16-0 into main
7 unresolved threads
6 files
+ 203
29
Compare changes
  • Side-by-side
  • Inline
Files
6
@@ -74,37 +74,26 @@ module TanukiEmoji
@@ -74,37 +74,26 @@ module TanukiEmoji
alpha_code = I18n.transliterate(emoji_data.description).gsub(/[^a-zA-Z#*\d]+/, '_').downcase
alpha_code = I18n.transliterate(emoji_data.description).gsub(/[^a-zA-Z#*\d]+/, '_').downcase
end
end
emoji = @index.find_by_codepoints(emoji_data.codepoints)
# This might be a different qualified version, basically same emoji but slightly different
 
# codepoint. Search on the alpha code and pull that. If found, add as alternate codepoint.
 
# "smiling face" is one example.
 
emoji = @index.find_by_alpha_code(alpha_code)
if emoji
if emoji
if emoji.alpha_code != alpha_code
emoji.add_codepoints(emoji_data.codepoints)
# code might have been renamed, add as an alias
emoji.add_alias(alpha_code)
@index.update(emoji)
@index.update(emoji)
end
else
else
# This might be a different qualified version, basically same emoji but slightly different
# not found, add a new emoji
# codepoint. Search on the alpha code and pull that. If found, add as alternate codepoint.
emoji = Character.new(alpha_code,
# "smiling face" is one example.
codepoints: emoji_data.codepoints,
emoji = @index.find_by_alpha_code(alpha_code)
alpha_code: alpha_code,
description: emoji_data.description,
if emoji
category: emoji_data.group_category)
emoji.add_codepoints(emoji_data.codepoints)
emoji.unicode_version = emoji_data.version
@index.update(emoji)
else
@index.add(emoji)
# not found, add a new emoji
emoji = Character.new(alpha_code,
codepoints: emoji_data.codepoints,
alpha_code: alpha_code,
description: emoji_data.description,
category: emoji_data.group_category)
emoji.unicode_version = emoji_data.version
@index.add(emoji)
end
end
end
end
end
end
end
Loading