I have the string "re\x{0301}sume\x{0301}" (which prints like this: résumé) and I want to reverse it to "e\x{0301}muse\x{0301}r" (émusér). I can’t use Perl’s reverse because it treats combining characters like "\x{0301}" as separate characters, so I wind up getting "\x{0301}emus\x{0301}er" ( ́emuśer). How can I reverse the string, but still respect the combining characters?
I have the string "re\x{0301}sume\x{0301}" (which prints like this: résumé) and I want to
Share
The best answer is to use Unicode::GCString, as Sinan points out
I modified Chas’s example a bit:
split(doesn’t work after 5.10, apparently, so I removed it)It’s basically the same thing with a couple of tweaks.