Re: Conversion UTF-8 vers autre codec

Stéphane Rivière via Ada-france <[email protected]> Thu, 20 May 2021 14:21:32 +0200
Newsgroups gmane.comp.lang.ada.france
Organization La Maison
Message-ID <[email protected]>
> Je recommande vivement le visionnage de
> « Characters, Symbols and the Unicode Miracle - Computerphile »
> https://www.youtube.com/watch?v=MijmeoH9LT4

Merci Vincent, c'est effectivement brillant ! ;)

Et les commentaires sont pas mal non plus...

While designing ASCII they also chose "00110000" (48) for character
zero. This is even more impressive than "a is 1" since you can then XOR
any character with the value of character zero to find out if it's a
decimal number (0 through 9)! :)

In code example:
char x = random(0, 128);
if (x ^ '0' < 10) {
// variable x is a decimal number character
} else {
// variable x is NOT a decimal number character
}

-- 
Stéphane Rivière
Ile d'Oléron - France
_______________________________________________
Ada-france mailing list
[email protected]
https://mail.ada-france.org/cgi-bin/mailman/listinfo/ada-france