You are here: Reference > JavaScript > client-side > ActiveX > HtmlDlgSafeHelper objects > methods > getCharset (HtmlDlgSafeHelper)

getCharset method (HtmlDlgSafeHelper)

Browser support:
Returns the default character set (code page) of the given font in Internet Explorer on Windows.
The following table contains the identifier/name pairs for the character sets:
0 ANSI Charset.
1 System Default Charset.
2 Symbol Charset.
3 Invalid Charset.
77 Macintosh Charset.
128 Japanese (Shift-JIS) Charset.
129 Korean (Hangul, Wansung) Charset.
130 Korean (Johab) Charset.
134 Simple Chinese (GB2312) Charset.
136 Traditinoal Chinese (Big5) Charset.
161 Greek Charset.
162 Turkish Charset.
163 Vietnamese Charset.
177 Hebrew Charset.
178 Arabic Charset.
179 Arabic Traditional Charset.
180 Arabic user Charset.
181 Hebrew user Charset.
186 Baltic Charset.
204 Russian Charset.
222 Thai Charset.
238 Eastern European Charset.
254 PC 437 Charset.
255 OEM Charset.

Syntax:

object.getCharset (fontName);
You can find the related objects in the Supported by objects section below.

Parameters:

fontName
Required. String that specifies the name of the font type (Times New Roman, Arial, Tahoma ...).

Return value:

Integer, the identifier of the code page.

Example HTML code 1:

This example illustrates the use of the getCharset method:
<head>
    <script type="text/javascript">
        function GetCharSet () {
            try {
                var dlgHelper = document.getElementById ("dlgHelper");
                var charSet = dlgHelper.getCharset ("Symbol");
                alert (charSet);
            }
            catch (e) {
                alert ("Your browser does not support this example!");
            }
        }
    </script>
</head>
<body>
        <!-- The Dialog Helper Object for the getCharset method -->
    <object id="dlgHelper" classid="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></object>
    <button onclick="GetCharSet ()">Get the default character set of the 'Symbol' font</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

External links:

User Contributed Comments

Post Content

Post Content