You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Brian Minchau (JIRA)" <xa...@xml.apache.org> on 2005/06/07 23:48:44 UTC

[jira] Commented: (XALANJ-2087) Get rid of the dependency on sun.io.CharToByteConverter

    [ http://issues.apache.org/jira/browse/XALANJ-2087?page=comments#action_12312945 ] 

Brian Minchau commented on XALANJ-2087:
---------------------------------------

I'm about to attach a patch. For those who care to review it, here is an outline of the changes:

ToTextStream.java
 - the writeNormalizedChars(...) method always passed a value of false for isCData, so this parameter was dropped, allowing for
  cleanup of the method.
 - the logic in writeNormalizedChars(...) was modified to  NOT as if (c <= M_MAXCHARACTER), but do the right thing for both single chars and
   high/low surrogate pairs of chars.
 - an exception is no longer thrown when a character that is not in the encoding is encountered. The error message is written out, the character is
   written to the writer and processing proceeds. This is kinder/gentler than before,  as it had cause some grief.

ToXMLStream.java
 - the CopyFrom method, that copies properties from another XML serializer does not copy the m_maxCharacter field (which no longer exists), but
   does copy the new m_encodingInfo field.

ToStream.java ( a super class of ToXMLStream, ToTextStream and ToHTMLStream)
 - dropped fields: m_triedToGetConverter, m_charToByteConverter (related to sun.io.CharToByteConverter)
 - dropped field:  m_maxCharacter which was only used as a poor way of figuring if a character was in the encoding.
 - essentially moved isUTF16Surrogate(char c) into the Encodings class.
 - escapingNotNeeded(char ch) now uses the new m_encodingInfo field to ask if a char is in the encoding rather than the    
   sun.io.CharToByteConverter.
 - error message move from writeUTF16Surrogate() into its caller writeUTF16Surrogate

Encodings.java
 - dropped code related to sun.io.CharToByteConverter
 - added/moved a few utility methods to determine if a char is a high or low surrogate, and a method to get the unicode code point 
   given the high/low pair

EncodingInfo.java
 - previously a simple class to hold just the ISO name, and Java name of the encoding and the last printable character
 - last printable character field is dropped,  but an InEncoding interface is added, and a field of that type, as well is binary search code using
   this (see the javadoc in the class). The long and short is that this class which previously had the Java name of the encoding, can now be asked if a char, or a high/low surrogate pair, is in the encoding.  



> Get rid of the dependency on sun.io.CharToByteConverter
> -------------------------------------------------------
>
>          Key: XALANJ-2087
>          URL: http://issues.apache.org/jira/browse/XALANJ-2087
>      Project: XalanJ2
>         Type: Improvement
>   Components: Xalan
>     Versions: CurrentCVS
>     Reporter: Jack
>     Assignee: Brian Minchau
>  Attachments: Converter.java, Encodings&Converter.zip
>
> The class org.apache.xml.serializer.Encodings references sun.io.CharToByteConverter directly, while the latter is not a public API. Is it possible to use java.nio.charset classes instead to remove this dependency?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org