Just a note.

From my own testing just now it seem that the error occurs when you try to decode "strange" character that are not UTF-8 encoded to start with.

For this exercise let's call the ascii chars Alt+131 Alt+132 Alt+133 "[chars]"
//echo -a [chars]

This will (should?) give you: a[accent circonflex] a[umlaut] a[accent grave].
Now copy these chars and paste them in the editbox. You'll see they appear as your input [chars]

//echo -a $utfencode([chars])

Copy them again and you'll see something completely else.

The $utfencoded chars you'll be able to throw into a $utfdecode identifier and decode them back to [chars]. However, the non-encoded ascii chars will give you an 'invalid parameters' error.
It works fine if you add any standard chars below ascii value 127 (Alt+127, you'll notice, is the last char when you paste utfencoded text).

So apparently any char that's not found in the ascii table between 1 and 127 and not UTF-8 encoded will cause your script to error out. There *could* be parameters to circumvent this, but since the identifier is not documented...

For what it's worth. :P

Last edited by 5618; 20/12/08 04:49 PM.