|
|
|
|
|
by jprzybyl
3555 days ago
|
|
> Shouldn't rev(1) reverse graphemes instead of code points? I honestly don't know. Is the intended purpose of this program to reverse bytes, or reverse characters, or reverse grapheme clusters? Or extended grapheme clusters? There's no spec - this has never been in POSIX. What is your expected behavior? Is it mine? For what it's worth, I needed rev recently, but forgot that it existed and did this: perl -ne 'chomp; print scalar reverse . "\n"'
If I need it to handle UTF-8 in a certain way, I can use pragmas to change it's behavior. (I'm pretty sure that this, as it is, will ignore the surrounding locale.) |
|