-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
225 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,222 @@ | ||
--- | ||
title: μ΄λͺ¨μ§μ μ΄λͺ¨μ λͺ¨ | ||
date: 2024-01-06 10:32:51 +0900 | ||
updated: 2024-01-07 23:04:46 +0900 | ||
aliases: ['μ΄λͺ¨μ§μ μ΄λͺ¨μ λͺ¨'] | ||
tags: ['κΈλ'] | ||
draft: false | ||
--- | ||
|
||
μΉμ μ μνλ 맀μΌ, μ΄λͺ¨μ§(Emoji)λ₯Ό λ³΄μ§ μλ λ μ΄ μλ€. κ·Έλ§νΌ μ΄λͺ¨μ§λ μνμ κΉμμ΄ λ€μ΄μλ€. | ||
μ΄λͺ¨μ§λ λ€λ₯Έ λ¬Έμμ λκ° λ€λ₯Έ κ±ΈκΉ? μ΄λ»κ² νμλλ κ±ΈκΉ? μ΄λͺ¨μ§μ λν΄ μκΈ΄ κΆκΈμ¦μ ν΄κ²°ν΄ λ³΄κ³ μ νλ€. | ||
|
||
## μ΄λͺ¨μ§ | ||
|
||
![NTT DOCOMO Emoji](https://blog.emojipedia.org/content/images/2019/03/emojipedia-softbank-docomo-apple-1997-1999-2018.jpg) | ||
|
||
μ΄λͺ¨μ§λ κ°μ , κΈ°νΈ λλ μ¬λ¬Όμ λνλ΄λ λ° μ¬μ©λλ κ·Έλ¦Ό λ¬Έμλ€. μλλ μΌλ³Έ ν΄λν°μμ μ¬μ©νμ§λ§ μ§κΈμ μ μΈκ³μ μΌλ‘ μ¬μ©λλ€. "μ΄λͺ¨μ§"λ μ΄λ¦μ μΌλ³Έμ΄ η΅΅ζε(emoji)μμ μλ€. η΅΅(μ)λ κ·Έλ¦Όμ, ζε(λͺ¨μ§)λ λ¬Έμλ₯Ό μλ―Ένλ€. | ||
|
||
### μ΄λͺ¨ν°μ½ ? | ||
|
||
μμ λΆν° κ°μ μ λνλ΄λ λ¬Έμλ₯Ό "μ΄λͺ¨ν°μ½"μ΄λΌ λΆλ λλ°, μ€λ§νΈν°μ μ¬μ©νμ λμ―€ "μ΄λͺ¨μ§"λ λ¨μ΄κ° λΆμ₯ λνλ¬λ€. 2κ°μ§κ° λ¬΄μ¨ μ°¨μ΄κ° μλμ§ κΆκΈνλ€. | ||
μ΄λͺ¨ν°μ½μ "emotion" + "icon"μΌλ‘ μ΄λ©μΌκ³Ό λ¬Έμ λ©μμ§μμ κ°μ μ μ λ¬νκΈ° μν΄ μ¬μ©νλ€. μλ₯Ό λ€λ©΄ `:-)`, `:-(`μ κ°μ κ²λ€μ΄λ€. μ΄λͺ¨μ§λ μ΄λ¦μμ μ μ μλ―μ΄ κ°μ λΏ μλλΌ λ€λ₯Έ κΈ°νΈλ μ¬λ¬Όλ€μ νννλ "κ·Έλ¦Ό λ¬Έμ"μΈ κ²μ΄λ€. κ·Όλ° λ³΄ν΅ μ΄ λ§λ μ°κ³ μ λ§λ μ°λ κ² κ°μ 보μΈλ€. | ||
|
||
## μ λμ½λμ UTF | ||
|
||
μ»΄ν¨ν°μμ λ°μ΄ν°λ `0`κ³Ό `1`λ‘ ννλλ€. λ¬Έμλ₯Ό `0`κ³Ό `1`λ‘ μ μ₯νλ κ²μ **"λ¬Έμ μΈμ½λ©"** μ΄λΌ νλ€. κ·ΈλΌ μ΄λ€ λ°μ΄ν°λ μ μΌλ° λ¬Έμλ‘ νμλκ³ μ΄λͺ¨μ§λ κ·Έλ¦Όμ΄ λνλλ κ±ΈκΉ? μ°μ μ»΄ν¨ν°μμ λ¬Έμλ₯Ό νννκΈ° μν΄ μ΄λ€ λ°©λ²μ μ¬μ©νλμ§ μμ보μ! | ||
|
||
![teleprinter](https://upload.wikimedia.org/wikipedia/commons/thumb/5/57/Fernschreiber_T100_Siemens.jpg/640px-Fernschreiber_T100_Siemens.jpg) | ||
|
||
1960λ λμ "Teleprinter"λΌλ κΈ°κΈ°κ° μμλ€κ³ νλ€. μ΄λ¦° μμ μ νμκΈ°λ₯Ό λ³Έ μ μ΄ μμλλ° κ·Έμ λΉμ·νκ² μκ²Όλ€. | ||
Teleprinterλ μ 보λ₯Ό λΆμΉκΈ° μν΄ κΈμ μ λ ₯ν΄μ κ·Έκ±Έ μ κΈ° μ νΈλ‘ λ°κΎΌ λ€, λ°λ μͺ½μμ μΆλ ₯νλ κΈ°κ³λ€. | ||
λ¬Έμκ° μ κΈ° μ νΈλ‘ λ³νλκΈ° μν΄ μ«μλ‘ λ³νμ΄ λ ν λ° μ΄ μ«μλ₯Ό 보λ΄λ λ°©λ²μ νμ€μ΄ νμν΄μ λ―Έκ΅μμ **ASCII**λΌλ νμ€μ λ§λ€μλ€. νμ€μ΄ νμν μ΄μ λ μ΄λ€ μ«μλ₯Ό 보λ΄λ©΄ λ°λ μͺ½μμ μ΄κ² μ΄λ€ λ¬Έμλ₯Ό μλ―Ένλμ§ νλ¨νλ κΈ°μ€μ΄ λκΈ° λλ¬Έμ΄λ€. | ||
|
||
ASCIIλ 7κ°μ bitλ₯Ό μ¬μ©νλ€. ν€λ³΄λλ‘ μΉλ κ° κΈμκ° 7bit μ΄μ§μλ‘ λ³κ²½λΌμ μ μ μ νκ³ μλλ°©μκ² μ μ‘λλ€. 7bitμ΄κΈ° λλ¬Έμ μ¬μ©ν μ μλ μ«μλ `0`μμ `127`μ΄λ€. | ||
|
||
![ASCII|https://www.vlsifacts.com/ascii-code/](http://www.vlsifacts.com/wp-content/uploads/2023/02/ASCII-Code.png) | ||
|
||
μ ASCII μ½λνλ₯Ό νμΈνλ©΄ μ μ μλ―μ΄ μ²μ 32κ° μ«μλ μ€λ°κΏ λ¬Έμ, λ°±μ€νμ΄μ€ λ±μ λ°°λΉνκ³ κ·Έ λ€λ‘ νΉμ λ¬Έμλ€κ³Ό μ«μλ₯Ό, `65`λΆν° μνλ²³μ΄ λ€μ΄κ°λ€. | ||
μ¬κΈ°μ νλμ νΉμ§μ `A`λ `65`λΌλ μ«μμ λ°°λΉνκΈ° λλ¬Έμ μ΄μ§μλ₯Ό λ΄€μ λ λ§μ§λ§ μ«μ 2κ°λ§ νμΈν΄μ λͺ λ²μ§Έ μνλ²³μΈμ§ νμΈν μ μμλ€λ μ μ΄λ€. | ||
|
||
``` | ||
1000001 // A | ||
1000010 // B | ||
1000011 // C | ||
1100001 // a | ||
1100010 // b | ||
1100011 // c | ||
``` | ||
|
||
μμ΄κΆ κ΅κ°μμλ μνλ²³μ μ¬μ©νκΈ° λλ¬Έμ νμ€μΌλ‘ μ μ°©λμμ§λ§ μνλ²³μ μ¬μ©νμ§ μλ μΈμ΄λ€μ λ§λ λ¬Έμ κ° μ겨λ¬λ€. κ·Έλμ ν΄λΉ μΈμ΄λ€μ κ°μμ μΈμ½λ© λ°©μμ μ¬μ©νλ€. μλ₯Ό λ€μ΄ νκΈμ EUC-KR μΈμ½λ© λ°©μμ μ¬μ©νλ€. | ||
|
||
κ·Έλ¦¬κ³ μκ°μ νλ¬ **World Wide Web**μ΄ λ±μ₯νκ³ , λ€μν λ¬Έμκ° ν¬ν¨λ λ¬Έμλ€μ΄ μ μΈκ³ κ³³κ³³μμ μ μ‘λκΈ° μμνλ€! μ§μ ν νμ€μ΄ νμν μκΈ°κ° μ°Ύμμ¨ κ²μ΄λ€. | ||
μ΄λ **μ λμ½λ**λΌλ κ²μ΄ λμλ€. μ λμ½λλ μ λμ½λ 컨μμμμ΄λΌλ λΉμ리 λ¨μ²΄μμ κ΄λ¦¬νλλ° μ μΈκ³ λͺ¨λ λ¬Έμλ₯Ό νννκΈ° μν΄μ κ° λ¬Έμμ κ³ μ ν μ½λ ν¬μΈνΈ(μ«μ)λ₯Ό ν λΉνλ€. | ||
|
||
μλ₯Ό λ€μ΄ | ||
|
||
- νκΈ `γ±`μ `U+1100`μ ν λΉλμ΄ μκ³ | ||
- μ΄λͺ¨μ§ `πΆ`λ `U+1F415`μ ν λΉλμ΄ μλ€. | ||
|
||
![[hangul-choseong-kiyeok-symblcc.png|μΆμ²: symbol.cc]] | ||
![[dog-emoji-symblcc.png|μΆμ²: symbol.cc]] | ||
|
||
μ λμ¬ `U+`λ μ λμ½λλ₯Ό μλ―Ένκ³ `1F415`λ 16μ§μλ‘ λ μ½λ ν¬μΈνΈλ€. | ||
|
||
λ¬Έμλ₯Ό `0`κ³Ό `1`λ‘ μ μ₯νλ κ²μ "λ¬Έμ μΈμ½λ©"μ΄λΌκ³ νλ€. `UTF`λ μ λμ½λλ₯Ό μΈμ½λ©νλ λ°©μμ΄λ€. μ¦, μ½λ ν¬μΈνΈλ₯Ό μ»΄ν¨ν° λ©λͺ¨λ¦¬μ μ μ₯νλ λ°©μμ΄λ€. | ||
UTF μΈμ½λ©μ λμμ [μ΄ μμ](https://youtu.be/MijmeoH9LT4?feature=shared)μμ μμΈν νμΈν μ μλ€. | ||
|
||
UTF μΈμ½λ©λ μ¬λ¬ κ°μ§ λ°©μμΌλ‘ λλλλ°, UTF-8λ μκ³ UTF-16, UTF-32 λ±μ΄ μλ€. | ||
|
||
UTF-32λ₯Ό μλ‘ λ€λ©΄, μ΄λ¦μμ μ μ μλ―μ΄ μ½λ ν¬μΈνΈλ₯Ό 32bitλ‘ μ μ₯νλ κ²μ΄λ€. λ°λΌμ `U+1F415`λ `00 01 F4 15`κ° λκ³ λ©λͺ¨λ¦¬μμ 4byteλ₯Ό μ°¨μ§νλ€. | ||
|
||
[μΌλ°μ μΌλ‘ UTF-8μ λ§μ΄ μ¬μ©νκ³ μλ€κ³ νλ€.](https://stackoverflow.com/a/67773534) | ||
|
||
## κ·Έλμ μ΄λͺ¨μ§λ μ κ·Έλ¦ΌμΌλ‘ ννλλ κ±°μ§? | ||
|
||
μ΄λͺ¨μ§μ κΈ°ν λ€λ₯Έ λ¬Έμλ€μ μ λμ½λμ κ° μ½λ ν¬μΈνΈμ ν λΉλμ΄ μκΈ° λλ¬Έμ λ³ μ°¨μ΄λ μμ΄ λ³΄μΈλ€. κ·Έλμ λ΄κ° 'μ΄λͺ¨μ§λ κ·Έλ¦ΌμΈλ°!'λΌκ³ μΈμ³λ΄€μ μ΄λͺ¨μ§λ κ°κ°μ΄ νλμ λ¬ΈμμΈ κ²μ΄λ€. κ·Έλ μ§λ§ λ§μμ΄ λ΅λ΅νλ€. μ΄λͺ¨μ§λ... μ΄λ―Έμ§μ΄κΈ° λλ¬Έμ΄λ€. μμμ΄ μκ³ νλ €νλ€. κ²μμμΌλ‘λ§ λ λ¬Έμλ λ€λ₯΄λ€λ μ¬μ€μ΄ λ΄ λ§μμ λ λ΅λ΅νκ² λ§λ€μλ€. νμ§λ§ λ€μκ³Ό κ°μ μ¬μ€μ μκ² λμλ€. | ||
|
||
> μ΄λͺ¨μ§λ κΈκΌ΄μ΄λ€. | ||
`0`κ³Ό `1`λ‘ μ μ₯λ λ°μ΄ν°λ₯Ό μ¬λμ΄ μ½μ μ μλλ‘ λ¬Έμ 체κ³λ‘ λ³νν΄ νλ©΄μ νμν΄ μ£Όλ κ²μ μ°λ¦¬λ κΈκΌ΄(ν°νΈ)λΌ λΆλ₯Έλ€. | ||
κΈκΌ΄ νμΌμμ λ¬Έμ νλνλλ₯Ό "κΈλ¦¬ν"λΌ νλλ°, κ° κΈλ¦¬νμ μ΄λ―Έμ§λ₯Ό λ£μ μ μλ€. | ||
|
||
macμμ μ체 κ΄λ¦¬μ μ±μ μ΄μ΄λ³΄λ©΄ "Apple Color Emoji"λΌλ κΈκΌ΄κ³Ό ν¨κ» 3605κ° κΈλ¦¬νλ₯Ό κ°μ§κ³ μλ€λ μ€λͺ λ λ³Ό μ μλ€. | ||
![[mac-font-book.png|mac osμ μ체 κ΄λ¦¬μ]] | ||
ν μ€νΈλ₯Ό νΉμ κΈκΌ΄λ‘ νμ΄ννκ³ μμ λ μ΄λͺ¨μ§κ° λμ€λ κ²½μ° ν΄λΉ κΈκΌ΄μ μ΄λͺ¨μ§ κΈλ¦¬νκ° μμΌλ©΄ μ΄μ체μ λ λ€λ₯Έ κΈκΌ΄μ μ°Έμ‘°νκ² λλ€. | ||
|
||
![[dragon-emoji.png|κΈ°κΈ°λ§λ€ λͺ¨μμ΄ λ€λ₯΄λ€]] | ||
κ²°λ‘ μ μΌλ‘ κΈκΌ΄μ΄ λ€λ₯΄λ©΄ κΈμ λͺ¨μμ΄ λ€λ₯΄κ² 보μ΄λ κ²μ²λΌ κΈ°κΈ°λ§λ€ μ΄λͺ¨μ§μ λͺ¨μ΅μ΄ λ€λ₯Έ κ²μ΄λ€. | ||
|
||
## Variation Selector | ||
|
||
μ΄λ€ μ΄λͺ¨μ§λ€μ μ΄λ―Έ μμ λΆν° μ λμ½λμ μ‘΄μ¬νμλ€. μλ₯Ό λ€μ΄, β€λ μ½λ ν¬μΈνΈκ° `U+2764`λ‘ 1993λ λΆν° μ‘΄μ¬νλ€. μ΄λͺ¨μ§μλ β€οΈκ° μλ€. μ΄λͺ¨μ§λ₯Ό μν κΈκΌ΄ λ§κ³ λ λ€λ₯Έ κΈκΌ΄μλ ν΄λΉ μ½λ ν¬μΈνΈκ° μ‘΄μ¬νλ€λ κ²μ΄λ€. κ·ΈλΌ μ΄μ체μ λ λ μ€ μ΄λ€ κΈκΌ΄μ λ λλ§ ν΄μΌ νλμ§ κ²°μ νλ κ²μΌκΉ? | ||
μ¬κΈ°μ Variation Selector(`U+FE0F`)κ° νμνλ€. β€οΈλ μ½λ ν¬μΈνΈκ° `U+2764`μ§λ§ λ¬Έμ λ€μ `U+FE0F`κ° μλ€. κ·Έλμ λ€λ₯΄κ² λ λλ§ λλ€. | ||
|
||
## Zero Width Joiner | ||
|
||
μ΄λͺ¨μ§μ λν΄ μμ보면μ `ZWJ(Zero Width Joiner)`λΌλ κ²μ μκ² λμλ€. κ°μ₯ μ κΈ°νλ λΆλΆμ΄λ€. | ||
|
||
μ¬κΈ° λΆκ·Ήκ³° μ΄λͺ¨μ§κ° μλ€. | ||
|
||
```js | ||
const polarBear = 'π»ββοΈ' | ||
``` | ||
|
||
μ΄ `polarBear` λ³μμ [[JavaScript-Spread-syntax|spread λ¬Έλ²]]μ μ¬μ©ν΄ 보μ. | ||
|
||
```js | ||
;[...polarBear] // ['π»', '', 'β', 'οΈ'] | ||
``` | ||
|
||
4κ°μ λ°°μ΄λ‘ λλ μ§λ©΄μ 첫 λ²μ§Έλ‘ π», λ λ²μ§Έλ‘ λΉ λ¬Έμμ΄, μΈ λ²μ§Έλ β , λ€ λ²μ§Έλ‘ λΉ λ¬Έμμ΄μ΄ λμ¨λ€. π»ββοΈ λ λ κ°μ§ μ΄λͺ¨μ§λ₯Ό μ‘°ν©ν΄μ λ§λ€μ΄μ§λ κ² κ°μ 보μΈλ€! | ||
κ·Έλ λ€λ©΄ λΉ λ¬Έμμ΄μ 무μμΌκΉ? μ λ§ λΉ λ¬Έμμ΄μΈμ§ νμΈν΄ 보μ. | ||
|
||
JavaScriptμμ `charCodeAt`μ μ¬μ©νλ©΄ μ£Όμ΄μ§ indexμ ν΄λΉνλ μ λμ½λ κ°μ μ»μ μ μλ€. | ||
|
||
```js | ||
const [bear, one, snow, two] = [...polarBear] | ||
one.charCodeAt(0) // 8205 | ||
two.charCodeAt(0) // 65039 | ||
``` | ||
|
||
μ λμ½λ `8205`λ ZWJ(zero with joiner)μ΄κ³ `65039`λ μμμ μ΄ν΄λ΄€λ variation selectorλ€. β λ¬Έμλ μ΄λ―Έ μ‘΄μ¬νλ λ¬Έμμ΄κΈ°μ βοΈ μ΄λͺ¨μ§λ‘ νννλ €λ©΄ μ΄κ² νμνλ κ²μ΄λ€. | ||
κ·ΈλΌ π» μ΄λͺ¨μ§μ βοΈ μ΄λͺ¨μ§λ₯Ό ν©μΉκΈ° μν΄μλ ZWJλ₯Ό μ¬μ©νλ€λ μ¬μ€μ μ μ μλ€. | ||
|
||
μ΄κ±Έ λ°λ‘ λ³μμ λ΄μμ ν μ€νΈν΄ 보μ. | ||
|
||
```js | ||
const [bear, ZWJ, snow, VARIATION_SELECTOR] = [...polarBear] | ||
const woman = 'π©' | ||
const rice = 'πΎ'[(woman, ZWJ, rice)].join('') // π©βπΎ | ||
``` | ||
|
||
μ΄μ²λΌ μ΄λͺ¨μ§λ νλλ‘ κ²°ν©μ ν μ μλ€! μ΄λͺ¨μ§ μ‘°ν©μ 'Emoji ZWJ Sequence'λΌ νλ€. λͺ¨λ μ΄λͺ¨μ§κ° μ‘°ν©μ΄ κ°λ₯ν κ²μ μλμ§λ§ [λ€μν μ‘°ν©μ΄ κ°λ₯](https://emojipedia.org/emoji-zwj-sequence)νλ€. | ||
|
||
μ΄μ¨κ±°λ λ¬Έμμ΄ λ°°μ΄λ‘ λ§λ€ μ μκΈ° λλ¬Έμ λ°°μ΄ λ©μλλ₯Ό μ¬μ©ν΄ λ€μ λμλ κ°λ₯νλ€. | ||
|
||
```js | ||
'π¨βπ©βπ¦'.replace('π¦', 'π§') // π¨βπ©βπ§ | ||
``` | ||
|
||
## μ΄λͺ¨μ§ μμΈμ μ‘ | ||
|
||
μ΄λͺ¨μ§μ λν΄ μμ보면μ κ°λ°ν λ μμλλ©΄ μΈ λ° μκΈ΄ νμ§λ§ κ·Έλλ μκ² λ κ²λ€μ΄ λͺ κ°μ§ μλ€. | ||
|
||
### Database | ||
|
||
첫 λ²μ§Έλ λ΄κ° μ€μ λ‘ κ²ͺμλ λ¬Έμ μΈλ° MySQLμμ ν μ€νΈ λ°μ΄ν°μ μ΄λͺ¨μ§λ₯Ό μ μ₯νκ³ μΆμλλ° μλ¬κ° λ°μνλ λ¬Έμ κ° μμλ€. | ||
μ΄κ±΄ MySQLμ΄ UTF-8μ ꡬννμ λ 3 byte λ¬Έμλ§ μ μ₯ν μ μμ΄μ μκΈ΄ λ¬Έμ μλ€. κ·Έλμ DBMSμ μΈμ½λ©μ utf8mb4λ‘ λ³κ²½ν΄μΌ νλ€. ([μ°Έκ³ ](https://www.lesstif.com/java/java-+-mysql-+-utf8mb4-emoji-51283094.html)) | ||
|
||
### μ΄λͺ¨μ§μ κΈΈμ΄ | ||
|
||
μ΄λͺ¨μ§ λΏλ§ μλλΌ μ λμ½λμμ μ¬λ¬ μ½λ ν¬μΈνΈλ‘ μ‘°ν©λ λ¬Έμλ₯Ό μ λλ‘ λ€λ£¨μ§ μμΌλ©΄ λ€μκ³Ό κ°μ λ²κ·Έκ° λ°μν μλ μλ€: | ||
![[editor.gif]] | ||
|
||
[codepen](https://codepen.io/)μ μλν°μΈλ° μ΄λͺ¨μ§ νλ(π»ββοΈ)λ₯Ό μ§μ°λλ° 4λ²μ ν€ μ€νΈλ‘ν¬κ° νμνλ€. μ§μ°κ³ λλ "π»"κ° λμ€λ κ±Έ 보λ μμμ spread λ¬Έλ²μΌλ‘ λλ μ§λ κ° μμκ° νλμ λ¬Έμλ‘ κ°μ£Όλμ§ μλ λ― λ³΄μΈλ€. | ||
|
||
κΈΈμ΄λ₯Ό ꡬν λλ λ¬Έμ κ° μλ€. JavaScriptμμ λ¬Έμμ΄μ κΈΈμ΄λ₯Ό ꡬν λ `length` λ©μλλ₯Ό μ¬μ©νλ€. λ€μ μ½λλ₯Ό μ΄ν΄λ³΄μ. | ||
|
||
```js | ||
const a = 'a' | ||
const b = 'κ°' | ||
const c = 'π' | ||
|
||
a.length // 1 | ||
b.length // 1 | ||
c.length // 2 | ||
``` | ||
|
||
`c` λ³μμ ν λΉν μ΄λͺ¨μ§λ νλμμλ λΆκ΅¬νκ³ μμκ³Ό λ€λ₯΄κ² κΈΈμ΄κ° `2`κ° λμ¨λ€. μ΄κ² λ¬΄μ¨ μΌμΌκΉ? | ||
|
||
JavaScriptλ λ¬Έμμ΄μ UTF-16μΌλ‘ λ€λ£¨κΈ° λλ¬Έμ΄λ€. πμ μ λμ½λλ `U+1F680`κ³ UTF-32λ‘ μΈμ½λ©νλ©΄ `0001F680`, UTF-16λ‘ μΈμ½λ©νλ©΄ `0xD83D`μ `0xDE80`μ΄λΌκ³ νλ€. κ·Έλμ κΈΈμ΄κ° `2`κ° λλ κ²μ΄λ€. | ||
|
||
[Lodashλ `toArray`λ‘ μ΄ λ¬Έμ λ₯Ό ν΄κ²°νλ€κ³ νλ€.](https://stackoverflow.com/a/46085147) | ||
|
||
```js | ||
import _ from 'lodash' | ||
_.toArray('π»ββοΈλΆκ·Ήκ³°').length // 4 | ||
``` | ||
|
||
--- | ||
|
||
DeppL λ²μμ±μ νμ₯ νλ‘κ·Έλ¨λ, | ||
![[deepl-polarbear.png]] | ||
|
||
λ§μΆ€λ² κ²μ¬κΈ°λ κΉ¨μ Έμ λμ¨λ€. | ||
![[naver-polarbear.png]] | ||
|
||
κ·Έλ¦¬κ³ [Terminalμμλ μ΄μ λΉμ·ν λ¬Έμ κ° μλ€](https://darrenburns.net/posts/emoji-in-the-terminal/)κ³ νλ€. | ||
|
||
### κ²μμ°½ μλμμ± | ||
|
||
κ΅¬κΈ κ²μμ°½μ μ΄λͺ¨μ§λ₯Ό μ λ ₯ν΄λ μλμμ±μ΄ λλ€. | ||
|
||
![[google-autocomplete.png]] | ||
ZWJ Sequence μ΄λͺ¨μ§λ₯Ό μ λ ₯νλ©΄ λΆλ¦¬λΌμ νμλλ κ²μ νμΈν μ μμλ€! | ||
|
||
μΏ ν‘μ π»ββοΈλ₯Ό κ²μνλλ° π»κ° μλμμ±λλ€. | ||
![[coupang-autocomplete-polarbear.png]] | ||
|
||
νμ§λ§ π»λ§ μ λ ₯νλ©΄ μλμμ±μ΄ λμ§ μλλ€. | ||
![[coupang-autocomplete-bear.png]] | ||
|
||
bingμ π»ββοΈ λ§ μλμμ±λλ€. | ||
![[bing-autocomplete-polarbear.png]] | ||
|
||
π»λ₯Ό κ²μνλ©΄ λ€λ₯Έ κ³°λ€λ λμ¨λ€. | ||
![[bing-autocomplete-bear.png]] | ||
|
||
μλμμ± κΈ°λ₯μ ꡬνν λ λ¬Έμμ΄μ μ²λ¦¬νλ λ°©μμ λ°λΌ λ€μνκ² λμνλ 보λ€. μ κ·Έλ°μ§λ μ’ λ νꡬν΄μΌκ² μ§λ§ μ΄μ κ° μμ§ μμκΉ? | ||
|
||
## κΈμ λ§μΉλ©° | ||
|
||
μ΄λͺ¨μ§μ μΈμ½λ©μ ~~μμ£Ό μκ²~~ 곡λΆνλ€. λ κΉμ΄ 곡λΆν΄μΌ ν νμμ±μ λλλ€. κ·Έλ¬κ³ λλ©΄ λ§μ§λ§μ μλΉμ€λ§λ€ μλμμ±μ΄ λ€λ₯΄κ² λμ€λ μ΄μ μ λν΄μλ μ μ μμ κ²μ΄λ€! | ||
|
||
## reference | ||
|
||
- [Unicodeμ UTF-8 κ°λ¨ν μ΄ν΄νκΈ°](https://jeongdowon.medium.com/unicode%EC%99%80-utf-8-%EA%B0%84%EB%8B%A8%ED%9E%88-%EC%9D%B4%ED%95%B4%ED%95%98%EA%B8%B0-b6aa3f7edf96) | ||
- https://gist.github.com/mandel59/d05522cdb42a652bf423 | ||
- [Zero Width Joiner](https://youtu.be/z0uUK0DUXro?feature=shared) | ||
- [The Absolute Minimum Every Software Developer Must Know About Unicode in 2023](https://tonsky.me/blog/unicode/) | ||
- [What is the unicode variation selector](https://stackoverflow.com/questions/4974668/what-is-the-unicode-variation-selector) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters