A complete list of available
code page identifiers
can be found in Microsoft's documentation for the Win32 API.
All data exchanged with an FTP server is sent and received as
8-bit bytes, typically referred to as "octets" in networking
terminology. However, the internal string type used by ActiveX controls
are Unicode, with each character represented using 16 bits. When you send
and receive data using the String data type, they will automatically
be converted to a stream of bytes.
By default, strings are converted to an array of bytes using UTF-8
encoding, mapping the 16-bit Unicode characters to 8-bit bytes.
Similarly, when reading data into a string buffer, the stream of bytes
received from the remote host are converted to Unicode before they are
returned to your application.
If the text you receive appears to corrupted or characters are being
replaced with question marks or other symbols, it is likely the file
on the server is using a different character encoding. Most applications
use UTF-8 encoding to represent non-ASCII characters; however, some text
files may use a localized character set rather than using Unicode. Using
the GetText and PutText methods in combination with this
property will change how that text is converted to Unicode.
|
Strings are only guaranteed to be safe
when sending and receiving text. Using a string data type is not
recommended when uploading or downloading binary data. If
possible, you should always use a byte array when using the
GetData and PutData methods.
|
This property value directly corresponds to
Windows code page identifiers, and will accept any valid code page in
addition to the values listed above. Setting this property to an invalid
code page will result in an error.
Although strings in Visual Basic are internally managed as Unicode,
the default common controls used in Visual Basic 6.0 do not support
Unicode. Those controls, such as buttons, text boxes and labels, will
automatically convert the Unicode text to ANSI using the current code
page. This means that text in the end-user's native language
(depending on system settings) may display correctly, although text
in other languages using different character sets may not. Also note
that the VB6 IDE is not Unicode aware and may display corrupted string
values or invalid characters, such as with tooltip values when
debugging.
For Unicode support in Visual Basic 6.0, it's recommended that you
use third-party controls. An alternative that some developers have
used is the Microsoft Forms 2.0 Object Library (FM20.DLL) that is part
of Microsoft Office. It includes a collection of controls that support
Unicode, however they are not redistributable and Microsoft has stated
that their use with VB6 is unsupported.