vendredi 27 février 2015

Thai string manipulation issues caused by incorrect string length

I am trying to highlight some substring in a Thai text:



high = high.Insert(myString.Index + myString.Length + "<b>" + currentLength, "</b>");


The issue is, that the myString string contains a special Thai character ("เงินฝาก"). The given string should have a length of 7, but the length is resolved as 6. Which highlights the text only partially, not including the last character.


I've tried encoding the string (both the high and myString string). But it didn't work. Do you have any tips on how to handle this? I've also tried the replace method, but to no avail.


Thanks in advance!


Aucun commentaire:

Enregistrer un commentaire