THe reason for your problem is the encoding and the read direction (
RightToLeft
). When changing to Urdu the system uses a
Unicode
character table which uses 2 bytes to describe each Urdu character instead of 1 byte when using
ANSI
or
ASCII
character tables. The simpliest solution would be to double the value of the
len
parameter and use
Right
instead of
Left
function. Also place the three points left of the truncated string as Richard suggested. For a really correct handling you should make use of the
Encoding
functions in VB.NET.
Maybe this link can help for your understanding:
How to convert/display a unicode string in vb.net | Nishant Pant's Techie Blog[
^]
For encoding functions have a look here:
Encoding-Klasse (System.Text)[
^]