Skip to content

Commit

Permalink
fix: broken emoji symbol names (#822)
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis authored Aug 30, 2023
2 parents f64fc63 + 0db5e67 commit d6379da
Show file tree
Hide file tree
Showing 4 changed files with 5,482 additions and 5,479 deletions.
10 changes: 9 additions & 1 deletion buildtools/emojis.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

ini_set("default_charset", "UTF-8");

echo "-- Autogenrating include/dpp/unicode_emoji.h\n";

$url = "https://raw.githubusercontent.com/ArkinSolomon/discord-emoji-converter/master/emojis.json";
Expand Down Expand Up @@ -29,7 +31,13 @@
if (preg_match("/^\d+/", $name)) {
$name = "_" . $name;
}
$header .= " constexpr const char " .$name . "[] = \"$code\";\n";
$name = str_replace("-", "minus", $name);
$name = str_replace("+", "plus", $name);
$name = str_replace("ñ", "n", $name);
if ($name == "new") {
$name = "_new";
}
$header .= " inline constexpr const char " .$name . "[] = \"$code\";\n";
}
$header .= "}\n};\n";
file_put_contents("include/dpp/unicode_emoji.h", $header);
Expand Down
Loading

0 comments on commit d6379da

Please sign in to comment.