> One reason for not implementing it in the standard library is that there
> are many possible implementations. Do you want to reverse combining
> character sequences for example? Unicode is a complex beast and I suspect
> that reversing a string rune-by-rune may easily break important
> semantics.

What Roger is saying is that taking the sequence « e - combining acute »
and reversing it rune-by-rune yields a sequence starting with
a combining character, which doesn't make a lot of sense sense.

> Is it even possible to do it correctly in general ?

Depends how you define correct, obviously.  If you want to ensure it's
invariant with respect to compatibility equivalence, you'll need to
normalise first (due to some compatibility characters normalising in
weird ways, for example U+0133 normalises to (U+0069, U+006A)).  I'm not
sure if plain equivalence has similar pathologies.

> Unicode is a complex beast

Granted.

-- Juliusz

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/87imk6yzrt.fsf%40pirx.irif.fr.

Reply via email to