A complete list of available
code page identifiers
can be found in Microsoft's documentation for the Win32 API.
All data which is exchanged over a socket 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 where each character is represented by 16 bits. To send
and receive data using strings, these Unicode strings are converted
to a stream of bytes.
By default, strings are converted to an array of bytes using the code
page for the current locale, mapping the 16-bit Unicode characters to
bytes. Similarly, when reading data from the socket 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 you are exchanging text with another system and it appears
to corrupted or characters are being replaced with question marks or
other symbols, it is likely the system is sending text which is using
a different character encoding. Most services use UTF-8 encoding
to represent non-ASCII characters and selecting the UTF-8 code page
will typically resolve the issue.
|
Strings are only guaranteed to be safe
when sending and receiving text. Using a string data type is not
recommended when reading or writing binary data to a socket. If
possible, you should always use a byte array as the buffer parameter
for the Read and Write methods
whenever you are exchanging binary data.
|
For backwards compatibility, the control defaults to using the code
page for the current locale. 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.