All Projects โ†’ mathiasbynens โ†’ flag-emoji-replacements

mathiasbynens / flag-emoji-replacements

Licence: other
'๐Ÿ‡ฉ๐Ÿ‡ฐ๐Ÿ‡ฒ๐Ÿ‡ฌ'.replace('๐Ÿ‡ฐ๐Ÿ‡ฒ', '๐Ÿ‡ช๐Ÿ‡จ'); // โ†’ '๐Ÿ‡ฉ๐Ÿ‡ช๐Ÿ‡จ๐Ÿ‡ฌ'

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to flag-emoji-replacements

SheenFigure
An implementation of advanced typographic tables of OpenType specification.
Stars: โœญ 24 (-35.14%)
Mutual labels:  unicode
BLogger
An easy to use modern C++14/17 async cross-platform logger which supports custom formatting/patterns, colored output, Unicode, file logging, log rotation & more!
Stars: โœญ 23 (-37.84%)
Mutual labels:  unicode
durdraw
Animated Unicode, ANSI and ASCII Art Editor for Linux/Unix/macOS
Stars: โœญ 55 (+48.65%)
Mutual labels:  unicode
ICU4N
International Components for Unicode for .NET
Stars: โœญ 18 (-51.35%)
Mutual labels:  unicode
character
tool for character manipulations
Stars: โœญ 26 (-29.73%)
Mutual labels:  unicode
unicodemoticon
Trayicon with Unicode Emoticons using Python3 Qt5
Stars: โœญ 21 (-43.24%)
Mutual labels:  unicode
MathTeXEngine.jl
A latex math mode engine in pure Julia.
Stars: โœญ 61 (+64.86%)
Mutual labels:  unicode
sugartex
SugarTeX is a more readable LaTeX language extension and transcompiler to LaTeX. Fast Unicode autocomplete in Atom editor via https://github.com/kiwi0fruit/atom-sugartex-completions
Stars: โœญ 74 (+100%)
Mutual labels:  unicode
rouziclib
This is my personal library of code that is common to my different projects (Photosounder, SplineEQ, Spiral and others)
Stars: โœญ 38 (+2.7%)
Mutual labels:  unicode
attic
A collection of personal tiny tools - mirror of https://gitlab.com/hydrargyrum/attic
Stars: โœญ 17 (-54.05%)
Mutual labels:  unicode
UnicodeBOMInputStream
Doing things right, in the name of Sun / Oracle
Stars: โœญ 36 (-2.7%)
Mutual labels:  unicode
TypeGame
๐Ÿ‘พ Sokoban Game in Pure TypeScript Type System
Stars: โœญ 222 (+500%)
Mutual labels:  unicode
urdu-characters
๐Ÿ“„ Complete collection of Urdu language characters & unicode code points.
Stars: โœญ 24 (-35.14%)
Mutual labels:  unicode
unicode-formatter
Convert portions of text to fancy text using unicode fonts for use on Twitter and other sites that don't support rich text
Stars: โœญ 31 (-16.22%)
Mutual labels:  unicode
couplet
Unicode code points support for Clojure
Stars: โœญ 21 (-43.24%)
Mutual labels:  unicode
cldr-engine
Internationalization and localization in Typescript with Unicode CLDR, batteries included
Stars: โœญ 34 (-8.11%)
Mutual labels:  unicode
opentype-shaping-documents
Documentation of OpenType shaping behavior
Stars: โœญ 121 (+227.03%)
Mutual labels:  unicode
Lingo
Text encoding for modern C++
Stars: โœญ 28 (-24.32%)
Mutual labels:  unicode
Stringy
๐Ÿ‰‘ Stringy - A PHP string manipulation library with multibyte support, performance optimized
Stars: โœญ 135 (+264.86%)
Mutual labels:  unicode
Tehreer-Cocoa
Standalone text engine for iOS
Stars: โœญ 31 (-16.22%)
Mutual labels:  unicode

Interesting flag emoji replacements

@iwsfutcmd shared an interesting observation:

'๐Ÿ‡ง๐Ÿ‡ฌ๐Ÿ‡ญ๐Ÿ‡ท'.replace('๐Ÿ‡ฌ๐Ÿ‡ญ', '๐Ÿ‡ฆ๐Ÿ‡ฌ'); // โ†’ '๐Ÿ‡ง๐Ÿ‡ฆ๐Ÿ‡ฌ๐Ÿ‡ท'

This repository contains every possible variation of this gotcha according to Unicode 14โ€™s RGI_Emoji_Flag_Sequence. Thereโ€™s 9,211,570 different variations clocking in at 718.50 MB, so the output is split across multiple files.

Examples:

'๐Ÿ‡ป๐Ÿ‡ฆ๐Ÿ‡ฉ๐Ÿ‡ฒ'.replace('๐Ÿ‡ฆ๐Ÿ‡ฉ', '๐Ÿ‡ฌ๐Ÿ‡บ'); // โ†’ '๐Ÿ‡ป๐Ÿ‡ฌ๐Ÿ‡บ๐Ÿ‡ฒ'
'๐Ÿ‡ฐ๐Ÿ‡ท๐Ÿ‡ช๐Ÿ‡น'.replace('๐Ÿ‡ท๐Ÿ‡ช', '๐Ÿ‡ณ๐Ÿ‡ฑ'); // โ†’ '๐Ÿ‡ฐ๐Ÿ‡ณ๐Ÿ‡ฑ๐Ÿ‡น'
'๐Ÿ‡จ๐Ÿ‡ต๐Ÿ‡ธ๐Ÿ‡จ'.replace('๐Ÿ‡ต๐Ÿ‡ธ', '๐Ÿ‡ป๐Ÿ‡จ'); // โ†’ '๐Ÿ‡จ๐Ÿ‡ป๐Ÿ‡จ๐Ÿ‡จ'
'๐Ÿ‡ง๐Ÿ‡ง๐Ÿ‡ธ๐Ÿ‡ฑ'.replace('๐Ÿ‡ง๐Ÿ‡ธ', '๐Ÿ‡ช๐Ÿ‡ฌ'); // โ†’ '๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ฌ๐Ÿ‡ฑ'
'๐Ÿ‡ฆ๐Ÿ‡น๐Ÿ‡จ๐Ÿ‡บ'.replace('๐Ÿ‡น๐Ÿ‡จ', '๐Ÿ‡ธ๐Ÿ‡ฒ'); // โ†’ '๐Ÿ‡ฆ๐Ÿ‡ธ๐Ÿ‡ฒ๐Ÿ‡บ'
'๐Ÿ‡ฌ๐Ÿ‡ฑ๐Ÿ‡ฆ๐Ÿ‡ช'.replace('๐Ÿ‡ฑ๐Ÿ‡ฆ', '๐Ÿ‡ฎ๐Ÿ‡ช'); // โ†’ '๐Ÿ‡ฌ๐Ÿ‡ฎ๐Ÿ‡ช๐Ÿ‡ช'
'๐Ÿ‡ฑ๐Ÿ‡ธ๐Ÿ‡ฒ๐Ÿ‡ญ'.replace('๐Ÿ‡ธ๐Ÿ‡ฒ', '๐Ÿ‡ฐ๐Ÿ‡ช'); // โ†’ '๐Ÿ‡ฑ๐Ÿ‡ฐ๐Ÿ‡ช๐Ÿ‡ญ'
'๐Ÿ‡น๐Ÿ‡ป๐Ÿ‡ฆ๐Ÿ‡ซ'.replace('๐Ÿ‡ป๐Ÿ‡ฆ', '๐Ÿ‡จ๐Ÿ‡ฌ'); // โ†’ '๐Ÿ‡น๐Ÿ‡จ๐Ÿ‡ฌ๐Ÿ‡ซ'
'๐Ÿ‡ฌ๐Ÿ‡ญ๐Ÿ‡ท๐Ÿ‡บ'.replace('๐Ÿ‡ญ๐Ÿ‡ท', '๐Ÿ‡ธ๐Ÿ‡ญ'); // โ†’ '๐Ÿ‡ฌ๐Ÿ‡ธ๐Ÿ‡ญ๐Ÿ‡บ'
'๐Ÿ‡ฆ๐Ÿ‡ฌ๐Ÿ‡ซ๐Ÿ‡ฎ'.replace('๐Ÿ‡ฌ๐Ÿ‡ซ', '๐Ÿ‡ฑ๐Ÿ‡ธ'); // โ†’ '๐Ÿ‡ฆ๐Ÿ‡ฑ๐Ÿ‡ธ๐Ÿ‡ฎ'
'๐Ÿ‡ฌ๐Ÿ‡ธ๐Ÿ‡ฎ๐Ÿ‡น'.replace('๐Ÿ‡ธ๐Ÿ‡ฎ', '๐Ÿ‡น๐Ÿ‡ฑ'); // โ†’ '๐Ÿ‡ฌ๐Ÿ‡น๐Ÿ‡ฑ๐Ÿ‡น'
'๐Ÿ‡ฌ๐Ÿ‡ฎ๐Ÿ‡ธ๐Ÿ‡ฌ'.replace('๐Ÿ‡ฎ๐Ÿ‡ธ', '๐Ÿ‡ง๐Ÿ‡ง'); // โ†’ '๐Ÿ‡ฌ๐Ÿ‡ง๐Ÿ‡ง๐Ÿ‡ฌ'
'๐Ÿ‡น๐Ÿ‡น๐Ÿ‡ฒ๐Ÿ‡ฆ'.replace('๐Ÿ‡น๐Ÿ‡ฒ', '๐Ÿ‡ฌ๐Ÿ‡น'); // โ†’ '๐Ÿ‡น๐Ÿ‡ฌ๐Ÿ‡น๐Ÿ‡ฆ'
'๐Ÿ‡ฌ๐Ÿ‡ผ๐Ÿ‡ซ๐Ÿ‡ฒ'.replace('๐Ÿ‡ผ๐Ÿ‡ซ', '๐Ÿ‡ง๐Ÿ‡ฏ'); // โ†’ '๐Ÿ‡ฌ๐Ÿ‡ง๐Ÿ‡ฏ๐Ÿ‡ฒ'
'๐Ÿ‡จ๐Ÿ‡ฐ๐Ÿ‡ฌ๐Ÿ‡ฆ'.replace('๐Ÿ‡ฐ๐Ÿ‡ฌ', '๐Ÿ‡ฒ๐Ÿ‡จ'); // โ†’ '๐Ÿ‡จ๐Ÿ‡ฒ๐Ÿ‡จ๐Ÿ‡ฆ'
'๐Ÿ‡ฒ๐Ÿ‡ณ๐Ÿ‡ฆ๐Ÿ‡ด'.replace('๐Ÿ‡ณ๐Ÿ‡ฆ', '๐Ÿ‡ซ๐Ÿ‡ฎ'); // โ†’ '๐Ÿ‡ฒ๐Ÿ‡ซ๐Ÿ‡ฎ๐Ÿ‡ด'
'๐Ÿ‡ช๐Ÿ‡ฆ๐Ÿ‡ฎ๐Ÿ‡จ'.replace('๐Ÿ‡ฆ๐Ÿ‡ฎ', '๐Ÿ‡ญ๐Ÿ‡ฒ'); // โ†’ '๐Ÿ‡ช๐Ÿ‡ญ๐Ÿ‡ฒ๐Ÿ‡จ'
'๐Ÿ‡ฎ๐Ÿ‡น๐Ÿ‡น๐Ÿ‡ญ'.replace('๐Ÿ‡น๐Ÿ‡น', '๐Ÿ‡ณ๐Ÿ‡ช'); // โ†’ '๐Ÿ‡ฎ๐Ÿ‡ณ๐Ÿ‡ช๐Ÿ‡ญ'
'๐Ÿ‡ต๐Ÿ‡ฌ๐Ÿ‡บ๐Ÿ‡ฌ'.replace('๐Ÿ‡ฌ๐Ÿ‡บ', '๐Ÿ‡ฒ๐Ÿ‡ฌ'); // โ†’ '๐Ÿ‡ต๐Ÿ‡ฒ๐Ÿ‡ฌ๐Ÿ‡ฌ'
'๐Ÿ‡ฑ๐Ÿ‡ธ๐Ÿ‡ธ๐Ÿ‡ฝ'.replace('๐Ÿ‡ธ๐Ÿ‡ธ', '๐Ÿ‡ฐ๐Ÿ‡ฒ'); // โ†’ '๐Ÿ‡ฑ๐Ÿ‡ฐ๐Ÿ‡ฒ๐Ÿ‡ฝ'
'๐Ÿ‡บ๐Ÿ‡พ๐Ÿ‡น๐Ÿ‡ป'.replace('๐Ÿ‡พ๐Ÿ‡น', '๐Ÿ‡ฒ๐Ÿ‡ฒ'); // โ†’ '๐Ÿ‡บ๐Ÿ‡ฒ๐Ÿ‡ฒ๐Ÿ‡ป'
'๐Ÿ‡ธ๐Ÿ‡ช๐Ÿ‡น๐Ÿ‡ฉ'.replace('๐Ÿ‡ช๐Ÿ‡น', '๐Ÿ‡ฑ๐Ÿ‡จ'); // โ†’ '๐Ÿ‡ธ๐Ÿ‡ฑ๐Ÿ‡จ๐Ÿ‡ฉ'
'๐Ÿ‡ฌ๐Ÿ‡ช๐Ÿ‡ธ๐Ÿ‡ญ'.replace('๐Ÿ‡ช๐Ÿ‡ธ', '๐Ÿ‡ธ๐Ÿ‡น'); // โ†’ '๐Ÿ‡ฌ๐Ÿ‡ธ๐Ÿ‡น๐Ÿ‡ญ'
'๐Ÿ‡ธ๐Ÿ‡ฉ๐Ÿ‡ฒ๐Ÿ‡ฌ'.replace('๐Ÿ‡ฉ๐Ÿ‡ฒ', '๐Ÿ‡ฌ๐Ÿ‡ช'); // โ†’ '๐Ÿ‡ธ๐Ÿ‡ฌ๐Ÿ‡ช๐Ÿ‡ฌ'
'๐Ÿ‡ธ๐Ÿ‡ฒ๐Ÿ‡ฆ๐Ÿ‡ฎ'.replace('๐Ÿ‡ฒ๐Ÿ‡ฆ', '๐Ÿ‡ง๐Ÿ‡ณ'); // โ†’ '๐Ÿ‡ธ๐Ÿ‡ง๐Ÿ‡ณ๐Ÿ‡ฎ'

To get a random example:

shuf -n 1 < output/$(ls output/ | shuf -n 1)

The general pattern is the following, where A, B, C, D, E, and F are all flag emoji, and {A, B} are distinct from {C, D, E, F}:

'AB'.replace('C', 'D'); // โ†’ 'EF'

Note that {C, D} may overlap with {E, F}, as that leads to even more confusing results, e.g.:

'๐Ÿ‡ฒ๐Ÿ‡ฆ๐Ÿ‡ธ๐Ÿ‡ฑ'.replace('๐Ÿ‡ฆ๐Ÿ‡ธ', '๐Ÿ‡ฒ๐Ÿ‡ฒ'); // โ†’ '๐Ÿ‡ฒ๐Ÿ‡ฒ๐Ÿ‡ฒ๐Ÿ‡ฑ'

Explanation

Unicode defines the following 26 Regional_Indicator symbols:

๐Ÿ‡ฆ ๐Ÿ‡ง ๐Ÿ‡จ ๐Ÿ‡ฉ ๐Ÿ‡ช ๐Ÿ‡ซ ๐Ÿ‡ฌ ๐Ÿ‡ญ ๐Ÿ‡ฎ ๐Ÿ‡ฏ ๐Ÿ‡ฐ ๐Ÿ‡ฑ ๐Ÿ‡ฒ ๐Ÿ‡ณ ๐Ÿ‡ด ๐Ÿ‡ต ๐Ÿ‡ถ ๐Ÿ‡ท ๐Ÿ‡ธ ๐Ÿ‡น ๐Ÿ‡บ ๐Ÿ‡ป ๐Ÿ‡ผ ๐Ÿ‡ฝ ๐Ÿ‡พ ๐Ÿ‡ฟ

Combining two of these into a country code results in the flag emoji for that country. So, @iwsfutcmdโ€™s example:

'๐Ÿ‡ง๐Ÿ‡ฌ๐Ÿ‡ญ๐Ÿ‡ท'.replace('๐Ÿ‡ฌ๐Ÿ‡ญ', '๐Ÿ‡ฆ๐Ÿ‡ฌ'); // โ†’ '๐Ÿ‡ง๐Ÿ‡ฆ๐Ÿ‡ฌ๐Ÿ‡ท'

โ€ฆis actually the following (with spaces added for clarity):

'๐Ÿ‡ง ๐Ÿ‡ฌ ๐Ÿ‡ญ ๐Ÿ‡ท'.replace('๐Ÿ‡ฌ ๐Ÿ‡ญ', '๐Ÿ‡ฆ ๐Ÿ‡ฌ'); // โ†’ '๐Ÿ‡ง ๐Ÿ‡ฆ ๐Ÿ‡ฌ ๐Ÿ‡ท'

The code replaces the second half (๐Ÿ‡ฌ) of the first flag emoji (๐Ÿ‡ง๐Ÿ‡ฌ) and the first half (๐Ÿ‡ญ) of the second flag emoji (๐Ÿ‡ญ๐Ÿ‡ท), thus changing both the first and second emoji.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].