rocca commited on
Commit
c198f3e
·
1 Parent(s): 7175e80

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +7 -0
README.md CHANGED
@@ -8,6 +8,13 @@ A collection of 38,176 emoji images from Facebook, Google, Apple, WhatsApp, Sams
8
  * More generally: `String.fromCodePoint(...filename.split("_")[1].split("-").map(n => parseInt(n, 16)))`
9
  * The tar files directly contain the image files (they're not inside a parent folder).
10
 
 
 
 
 
 
 
 
11
  ## Facebook examples:
12
  ![Facebook emoji grid](https://i.imgur.com/z0ZCHfO.jpg)
13
 
 
8
  * More generally: `String.fromCodePoint(...filename.split("_")[1].split("-").map(n => parseInt(n, 16)))`
9
  * The tar files directly contain the image files (they're not inside a parent folder).
10
 
11
+ Here's some JavaScript code to convert the file name of an emoji image into the actual Unicode emoji character:
12
+ ```js
13
+ let filename = ...;
14
+ let fixedFilename = filename.replace(/(no|light|medium|medium-light|medium-dark|dark)-skin-tone/, "").replace(/__/, "_").replace(/--/, "-");
15
+ let emoji = String.fromCodePoint(...fixedFilename.split("_")[1].split(".")[0].split("-").map(hex => parseInt(hex, 16)));
16
+ ```
17
+
18
  ## Facebook examples:
19
  ![Facebook emoji grid](https://i.imgur.com/z0ZCHfO.jpg)
20