I have a question. how to generate two files, one in UTF-8, the other in
ASCII with the same column length
SO that when i do the conversion from utf-8 to ascii or vice versa, the
column length does not change . any help is appreciated
thanks
It is quite important to get the terminology right:
The two files are identical, because (by definition) ASCII uses characters
in the range 0-127. In that range, UTF8 is identical with ASCII.
If what you want is not ASCII, but ANSI, we have to make clear what you mean
by "column length." You mean number of bytes, or number of characters?
If you mean number of characters, this is again not changed by ANSI - UTF8
conversion.
If you want number of bytes, this is not possible, because a character
above 127 in ANSI encoding can take between 2 and 4 bytes in UTF8
(depending on the ANSI code page), but never 1 byte.
So the number of bytes in UTF8 is guaranteed to be higher or equal to the
one in ANSI encoding.