From what I have determined, the Wordle "Share" function saves these Unicode characters:
Black Square: (U+2B1B)
White Square: (U+2B1C)
Yellow Square: (U+1F7E8)
Green Square: (U+1F7E9)
But when I look at the saved text in a Hex Editor, why does it instead show these values?
Black Square: e2 ac 9b
White Square: e2 ac 9c
Yellow Square: f0 9f 9f a8
Green Square: f0 9f 9f a9
The Hex Editor does indeed recognize those values as the above Unicode equivalents as it shows them in the side panel.
So how does e2 ac 9c get converted to 2b 1b, etc?
Never mind, I figured it out. It uses UTF-8 encoding.
e2 ac 9b
-> (in binary) 1110 0010 . 1010 1100 . 1001 1011
-> (bracketing the parts that are constant) [1110] 0010 . [10]10 1100 . [10]01 1011
-> (stripping out the parts in brackets) 0010 1011 . 0001 1011
-> 2b 1b
f0 9f 9f a8
-> 1111 0000 . 1001 1111 . 1001 1111 . 1010 1000
-> [1111 0]000 . [10]01 1111 . [10]01 1111 . [10]10 1000
-> (go right to left and add zeros as necessary on the left end to make it a full byte) 0000 0001 . 1111 0111 . 1110 1000
-> 01 f7 e8
Black Square: (U+2B1B)
White Square: (U+2B1C)
Yellow Square: (U+1F7E8)
Green Square: (U+1F7E9)
But when I look at the saved text in a Hex Editor, why does it instead show these values?
Black Square: e2 ac 9b
White Square: e2 ac 9c
Yellow Square: f0 9f 9f a8
Green Square: f0 9f 9f a9
The Hex Editor does indeed recognize those values as the above Unicode equivalents as it shows them in the side panel.
So how does e2 ac 9c get converted to 2b 1b, etc?
Never mind, I figured it out. It uses UTF-8 encoding.
e2 ac 9b
-> (in binary) 1110 0010 . 1010 1100 . 1001 1011
-> (bracketing the parts that are constant) [1110] 0010 . [10]10 1100 . [10]01 1011
-> (stripping out the parts in brackets) 0010 1011 . 0001 1011
-> 2b 1b
f0 9f 9f a8
-> 1111 0000 . 1001 1111 . 1001 1111 . 1010 1000
-> [1111 0]000 . [10]01 1111 . [10]01 1111 . [10]10 1000
-> (go right to left and add zeros as necessary on the left end to make it a full byte) 0000 0001 . 1111 0111 . 1110 1000
-> 01 f7 e8
Wordle
Date: 2022-05-30 02:33 pm (UTC)From: (Anonymous)Re: Wordle
Date: 2022-05-30 02:36 pm (UTC)From: (Anonymous)Re: Wordle
Date: 2022-05-30 05:54 pm (UTC)From:I was curious about this because whenever I clicked Share and pasted the results into a text file, all I saw was empty boxes or boxes with an X in them; no color. I didn't understand how that was converted into colored boxes when people pasted their results on Facebook and Twitter. First I thought the code must be saving the results in multiple formats - plain text and also an image file. But that turned out not to be the case. The Unicode characters allow you to include symbols like colored boxes in what is otherwise "plain text".
Re: Wordle
Date: 2022-05-30 08:19 pm (UTC)From: (Anonymous)https://techcrunch.com/2022/03/31/why-wordle-game-284-had-two-answers-and-how-to-fix/amp/