4 ms·
this isn't quite set up the way the article was mentioning. Here's with it set up correctly: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018
by qw3rty01 5y ago
this isn't quite set up the way the article was mentioning. Here's with it set up correctly:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=d654f40995af3f657e30e9a7575885bd https://play.rust-lang.org/?version=stable&mode=debug&editio...
It looks like it still misses some of the cases (specifically with decomposed vs precomposed).
As a side note, it looks like the playground editor also doesn't correctly render some of the lengths (the cursor is 1 character off on the decomposed case)
- brundolf 5y agoHuh, I'd never heard of decomposed/precomposed before and I kind of skimmed over them in the original article. Looking at your example, I still can't figure out what the difference is between the two (I guess the Playground editor itself just can't represent the difference?). I'll have to go read up on that concept. Edit: Having read about them, I guess I assumed that if my keyboard inputs an ë it's actually inputting those two underlying characters. Or to put it differently, I assumed there weren't two separate representations for the same character; that the "decomposed" and "precomposed" versions are one in the same, at the byte level. Learned something h̶o̶r̶r̶i̶f̶y̶i̶n̶g̶ new!
- qw3rty01 5y agoAfter a little bit of research, it looks like this is how you would get the expected outputs: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=217409b67e78635b4794f6bf87478e09 https://play.rust-lang.org/?version=stable&mode=debug&editio...