in reply to Re^2: Change encoding of a string from utf8 to iso-8859-2
in thread Change encoding of a string from utf8 to iso-8859-2

Apart from the fact that you haven't provided sample data or enough code to demonstrate what you mean by "does not work", you either didn't read or didn't understand what the Encode man page says about the "from_to()" function: from_to() returns the length of the converted string (in octets), after doing the conversion "in-place" (i.e. replacing the original content of a string variable with the converted content).

This one line of code you showed us is assigning the return value (length in octets) to the same variable that you are trying to convert. That obliterates whatever string you just converted, replacing it with a number.

  • Comment on Re^3: Change encoding of a string from utf8 to iso-8859-2