minus-squareabhibeckert@lemmy.worldtoProgramming@programming.dev•The Absolute Minimum Every Software Developer Must Know About Unicode in 2023 (Still No Excuses!)linkfedilinkarrow-up0·edit-22 years agoI love the comparison of string length of the same UTF-8 string in four programming languages (only the last one is correct, by the way): Python 3: len(“🤦🏼♂️”) 5 JavaScript / Java / C#: “🤦🏼♂️”.length 7 Rust: println!(“{}”, “🤦🏼♂️”.len()); 17 Swift: print(“🤦🏼♂️”.count) 1 linkfedilink
I love the comparison of string length of the same UTF-8 string in four programming languages (only the last one is correct, by the way):
Python 3:
JavaScript / Java / C#:
Rust:
Swift: