Assign encoding to a string problem

Hello,

Can you help me with the following problem :

Code :

Dim strCellValue As String strCellValue.Encoding = Encodings.UTF16

Gives me the following error message :
“This Item does not exist”
strCellValue.Encoding is highlighted.

while the following line :
tisSource.Encoding = Encodings.UTF16

works without any problem.
tisSource is a TextInputStream

I searched the language reference for any help, but whatever I tried, nothing worked.

Thank you in advance for your help.

Greetings,

Chris

You can’t modify a string’s encoding directly. Use the ConvertEncoding function:

strCellValue=ConvertEncoding(strCellValue, Encodings.UTF16)

Hello Eric,

Thank you very much for your help, which I appreciate very much.

Your solution is exactly what I need.

Wish you all the best.

Greetings,

chris
acra-endeavours