in reply to Re: UCS2/HexEncoded
in thread UCS2/HexEncoded

Better, with regards to Unicode (and after all, this is what UCS2 is about):
sub UCS2 { return join '', map { sprintf "%04X", ord } split //, $_[0] + } print UCS2 ("Hello\x{1234}");
Result:
00480065006C006C006F1234
As you can see, it works flawlessly with characters with a character code above 255.