Project

Profile

Help

How to connect?
Download (1.85 KB) Statistics
| Branch: | Tag: | Revision:

he / tags / 9.2.0.5 / hej / net / sf / saxon / charcode / package.html @ 90ee0d1a

1
<html>
2

    
3
<head>
4
<title>Package overview for net.sf.saxon.charcode</title>
5
</head>
6

    
7
<body>
8

    
9
<p>This package provides classes for handling different output character sets. </p>
10

    
11
<p>Most of the classes in this package are implementations of the interface <code>CharacterSet</code>.
12
    The sole
13
function of these classes is to determine whether a particular character is present in the
14
character set or not: if not, Saxon has to replace it with a character reference.</p>
15

    
16
<p>The actual translation of Unicode characters to characters in the selected encoding
17
is left to the Java run-time library. (Note that different versions of Java support
18
different sets of encodings, and there is no easy way to find out which encodings
19
are supported in a given installation).</p>
20

    
21
<p>It is possible to configure Saxon to support additional character sets by writing an
22
implementation of the <code>CharacterSet</code> interface, and registering this class with the
23
<code>Configuration</code> using the method <code>setCharacterSetImplementation()</code></p>
24

    
25
<p>If an output encoding is requested that Saxon does not recognize, but which the Java
26
platform does recognize, then Saxon attempts to determine which characters the encoding
27
can represent, so that unsupported characters can be written as numeric character references.
28
Saxon wraps the Java <code>CharSet</code> object in a <code>JavaCharacterSet</code> object,
29
and tests whether a character is encodable by calling the Java interrogative
30
<code>encoding.canEncode()</code>, caching the result locally. Since this mechanism
31
appears to have become reliable in JDK 1.5, it is now used much more widely than before,
32
and most character sets are now supported in Saxon by relying on this mechanism.</p>
33

    
34

    
35

    
36
<hr>
37

    
38
<p align="center"><i>Michael H. Kay<br/>
39
Saxonica Limited<br/>
40
9 June 2009</i></p>
41
</body>
42
</html>
(9-9/9)