Buf fix: good text length.
The encoding is separated in 2 steps now:
* first: transform text into array of number, depending of the encoding
* second: convert the array of number into a HEXA string