News for hackers. Stuff that matters.
Re:It’s Not Wrong that “ ”.length == 7 by ThunderSizzle on Friday June 02, 2023 @06:28AM (#36163375)
According to python. Every language can have a different definition. C#, for example, defines the blocks to be Char objects, which is based on UTF 16:

> The Length property of a string represents the number of Char objects it contains, not the number of Unicode characters.

https://learn.microsoft.com/en-us/dotnet/csharp/programming-...

Re:It’s Not Wrong that “ ”.length == 7 by WorldMaker on Friday June 02, 2023 @01:00PM (#36167726)
Though C# also recommends the Rune APIs for more modern/better code point handling. The Rune APIs have a bit more in common with Python 3's unicode treatment than the classic (and sometimes wrong) UTF-16 approach.

https://learn.microsoft.com/en-us/dotnet/api/system.text.run...