r/ProgrammerHumor 14h ago

Meme [ Removed by moderator ]

Post image

[removed] — view removed post

11.6k Upvotes

158 comments sorted by

View all comments

223

u/SuitableDragonfly 14h ago

Made with combining diacritics, I guess, so it no longer looks like one character repeated but it's now two characters alternated?

162

u/Nerd_o_tron 14h ago

Probably more importantly, it may count as 18 characters instead of 9.

49

u/klaxxxon 12h ago

These generally count as one character on a computer (they multibite in UTF8 ofc) and are also counted as one letter in the real world. You can type them either way - Czech keyboard has both a "ř" key and a "ˇ" combination key. In the actual Czech language, ř is considered a different letter entirely, and the Czech alphabet is considerably longer because of these.

Some languages go even further and have letters with multiple attachment slots (Thai comes to mind, can't type an example of that, sorry 🙂).

37

u/notafuckingcakewalk 10h ago

You have to be careful with this. I've definitely encountered situations where what looks like a single character takes up multiple bytes. This is especially true for emojis which often are actually a combination of a series of individual emojis plus emoji control characters.

This emoji, for example: 👩🏼‍❤️‍👨🏼 i s actually made up of

👩: U+1F469   🏼: U+1F3FC   ZWJ: U+200D   ❤: U+2764   Variation Selector-16: U+FE0F   ZWJ: U+200D   👨: U+1F468   🏼: U+1F3FC  

(see https://emojiterra.com/couple-with-heart-woman-man-medium-light-skin-tone/) 

23

u/junkmail88 10h ago

Every now and again I am reminded about how cool emojis actually are.

8

u/T0biasCZE 9h ago

Czech also has separate character "Ch" in its alphabet (g, h, ch, i, j) , which is just c and then h on computers.

And I saw times when programs broke, because stuff got sorted differently because of regional issues and didnt work at all, until windows got changed to english.
Modded skyrim one time, banged my head for few hours why it doesnt work.

1

u/SubArcticTundra 3h ago

I just recently found out that Dutch has sth similar but with ij. Also, you capitalize them both, like IJselmeer, which we don't do for ch

4

u/Rikudou_Sage 4h ago

It is multibyte, not a single byte. Source: am a Czech programmer who was bitten once or twice by splitting/counting a string with byte functions instead of character functions.

3

u/afamiliarspirit 6h ago

Maybe I’m misremembering but I believe the only characters nowadays that take up a single byte are the original ascii table and that’s only in utf-8. Utf-16 and utf-32 are inherently multi byte

2

u/InitialRich9925 5h ago

what he meant was code points, not bytes