|
Charset
Encoding
Component Reference
Properties
- FromCharset
As String read/write
- The MIME charset
to convert from, such as "utf-8", "iso-2022-jp",
"big5", or "iso-8859-1". [top]
- FullWidth
As Long read/write
- Only applicable
when converting to Big5. Causes the conversion to produce the
full-width Big5 character set instead of mixed-width (single-byte
ASCII mixed with double-byte Big5)[top]
- ToCharset
As Long read/write
- The MIME charset
to convert from, such as "gb2312", "euc-kr",
"koi8-u", or "windows-1255".[top]
- Version
As String read-only
- The version of
the component, such as "7.0.0"[top]
- SaveLast
As Long read/write
- If non-zero, the
component will save the input and output data for the last conversion,
which can then be retrieved in Base64 format. (Use the CkData
component in Chilkat Util to help convert and use Base64 data)
[top]
- LastInputAsBase64
As String read-only
- The input data
in Base64 for the most recent conversion. (The SaveLast property
must be set to 1 for the input and output data to be saved.)[top]
- LastOutputAsBase64
As String read-only
- The output data
in Base64 for the most recent conversion. (The SaveLast property
must be set to 1 for the input and output data to be saved.)[top]
- LastInputAsHex
As String read-only
- The input data
encoded as a Hex string for the most recent conversion. (The
SaveLast property must be set to 1 for the input and output
data to be saved.)[top]
- LastOutputAsHex
As String read-only
- The output data
encoded as a Hex string for the most recent conversion. (The
SaveLast property must be set to 1 for the input and output
data to be saved.)[top]
- LastInputAsQP
As String read-only
- The input data
in quoted-printable format for the most recent conversion. (The
SaveLast property must be set to 1 for the input and output
data to be saved.)[top]
- LastOutputAsQP
As String read-only
- The output data
in quoted-printable format for the most recent conversion. (The
SaveLast property must be set to 1 for the input and output
data to be saved.)[top]
- Methods
-
- BatchConvertFiles(
zipFileName as String ) As Long
- Converts the character
encoding of all the files contained within a Zip according to
the FromCharset and ToCharset properties. Returns the number
of failed conversions, and detailed information about the batch
conversion is logged to the XML-formatted log, which can be
saved to disk (SaveXmlLog), or retrieved by your program (GetXmlLog).
Each file in the Zip is replaced with the converted data. [top]
-
- BatchConvertHtml(
zipFileName
as String ) As Long
- Converts the character
encoding of all the HTML files contained within a Zip. The "from"
charset is determined by examining the HTML file and parsing
out the Meta tag containing the charset information, and if
that is not present, it uses the FromCharset property. The "to"
charset is determined by the ToCharset property. Returns the
number of failed conversions, and detailed information about
the batch conversion is logged to the XML-formatted log, which
can be saved to disk, or retrieved by your program. Each file
in the Zip is replaced with the converted data. [top]
-
- ConvertData(
inData As Variant) As Variant
- Converts text data
from one charset to another. Returns the converted data. [top]
-
- ConvertFile(
inFilename As String, outFilename As String ) As Long
- Converts the text
data from one file and creates another. [top]
-
- ConvertFromUnicode(
inText
As String ) As Variant
- Converts a Unicode
string to the charset specified by the ToCharset property. [top]
- ConvertFromUtf8(
inData
As Variant, long errorOption, long errorChar
) As Variant
- Converts utf-8
data to the charset specified by the ToCharset property. The
conversion is always successful, and characters that are not
representable in the target charset are handled according to
the errorOption parameter.
If errorOption = 0, then non-convertable characters are
dropped.
If errorOption = 1, non-convertable chars are hexidecimalized
to the format xxxxx; where there can be as many as 6 octets
in a single utf-8 character.
If errorOption = 2, non-convertable characters are replaced
with a single-byte specified by errorChar, which should be in
the range 0-255. [top]
- ConvertHtml(
inHtml As Variant) As Variant
- Converts HTML text
to another charset. The "from" charset is determined
by parsing out the charset information found in a META-tag,
or if that is not present, it uses the FromCharset property.
The HTML is converted to the charset specified by the ToCharset
property. The META-tag is updated, or added if it previously
did not exist. The converted HTML is returned. If the HTML could
not be converted, a NULL is returned.[top]
-
- ConvertHtmlFile(
inFilename As String, outFilename As String ) As Long
- Same as ConvertHTML,
but file-to-file instead of memory-to-memory. Returns 1 for
success, 0 for failure.[top]
-
- ConvertToUnicode(
inText as Variant ) As String
- Converts text data
from the FromCharset to a Unicode string. [top]
-
- DetectCharset(
inText as Variant ) As String
- Tries to detect
the charset by examining the character data. This method is
more accurate when more data is available to examine, but is
never 100% accurate. [top]
-
- DownloadHtml(
url As String ) As Variant
- A convenient method
to download the HTML from a URL. It does not download all external
referenced parts of the Web page -- it only downloads the HTML
text of a page. A NULL is returned if the Web page could not
be downloaded.[top]
-
-
-
- From_ISO_2022_JP()
From_ISO_ 2022_KR( )
From_EUC_JP()
From_EUC_CN()
From_EUC_KR()
From_GB2312()
From_BIG5()
From_SHIFT_JIS()
From_UTF_8()
From_KOI8_R()
From_KOI8_U()
From_US_ASCII()
- From_ISO_8859_1()
From_ISO_8859_2()
From_ISO_8859_3()
From_ISO_8859_4()
From_ISO_8859_5()
From_ISO_8859_6()
From_ISO_8859_7()
From_ISO_8859_8()
From_ISO_8859_9()
From_Windows_1250()
From_Windows_1251()
From_Windows_1252()
From_Windows_1253()
From_Windows_1254()
From_Windows_1255()
From_Windows_1256()
From_Windows_1257()
From_Windows_1258()
- Convenience methods
for setting the FromCharset property. These method represent
only a portion of the supported charsets. [top]
- GetHtmlCharset(
htmlData As Variant ) As String
- Parses HTML text
and returns the charset, such as "iso-8859-1" found
in the META-tag that specifies the document's charset. The string
"unknown" is returned if the charset was not specified.
This method does not try to detect the charset based by examining
the character data (like DetectCharset) but simply looks for
the META tag containing the charset information.[top]
- GetHtmlFileCharset(
fileName As String ) As String
- Same as GetHtmlCharset,
but operates on a file instead of memory. The string "unknown"
is returned if the charset is not specified in the HTML.[top]
- GetXmlLog(
) As String
- Returns the XML
log. [top]
- IsUnlocked(
) As Long
- Returns 1 if the
component is already unlocked, otherwise returns 0.[top]
- ReadFile(
filename As String ) As Variant
- Convenience method
for reading the entire contents of a file.[top]
- SaveXmlLog(
filename
As String )
- Saves the error
log to a file.[top]
- To_ISO_2022_JP()
To_ISO_
2022_KR( )
To_EUC_JP()
To_EUC_CN()
To_EUC_KR()
To_GB2312()
To_BIG5()
To_SHIFT_JIS()
To_UTF_8()
To_KOI8_R()
To_KOI8_U()
To_US_ASCII()
- To_ISO_8859_1()
To_ISO_8859_2()
To_ISO_8859_3()
To_ISO_8859_4()
To_ISO_8859_5()
To_ISO_8859_6()
To_ISO_8859_7()
To_ISO_8859_8()
To_ISO_8859_9()
To_Windows_1250()
To_Windows_1251()
To_Windows_1252()
To_Windows_1253()
To_Windows_1254()
To_Windows_1255()
To_Windows_1256()
To_Windows_1257()
To_Windows_1258()
- Convenience methods
for setting the ToCharset property. These method represent only
a portion of the supported charsets. [top]
- UnlockComponent(
unlockCode As String )
- Unlocks the component
to make it fully functional. A 30-day unlock code can be obtained
at http://www.chilkatsoft.com/register30.asp
- VerifyData(
charset
As String, textData As Variant ) As Long
- Verifies that the
text data contains only characters of the specified charset.
Returns 1 if OK, returns 0 if not.[top]
- VerifyFile(
charset
As String, filename As String
) As Long
- Verifies that a
text file contains only characters of the specified charset.
Returns 1 if OK, returns 0 if not.[top]
- WriteFile(
filename
As String, textData As Variant ) As Long
- Convenience function
for writing text to a file. [top]
-
-
-
|
|
Privacy
Statement. Copyright 2000-2008 Chilkat
Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com Components for Microsoft Windows XP, 2000, 2003 Server, Vista, and Windows 95/98/NT4.
|
|