in reply to Re^5: sring encode problem (hexadecimal)
in thread sring encode problem (hexadecimal)

Hi JavaFan

Thank you for your code. you are right. now it is work indeed
however in your code
line 7 my $string = "\x{20AC}";
Is "\x{20AC}" equvalent to "€";??


why do you use my $string = "\x{20AC}"; instead of $string = "€";
would it be possible to use
my $string = "€"; ??
as i would pass value from form to it . these value would be any double byte character.




Many thanks

  • Comment on Re^6: sring encode problem (hexadecimal)

Replies are listed 'Best First'.
Re^7: sring encode problem (hexadecimal)
by JavaFan (Canon) on Jan 20, 2011 at 19:31 UTC
    They are equivalent. I prefer to use \x{20AC} (and \x escapes in general) because that's encoding agnostic. If you write $string = "€";, I cannot see whether that's UTF-8, or perhaps ISO-8856-15.