atg.servlet.pagecompile
Class JapaneseConverter

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.servlet.pagecompile.JapaneseConverter
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, Converter, java.util.EventListener

public class JapaneseConverter
extends GenericService
implements Converter

Converts Japanese encoded text to UNICODE. Useful when the encoding method of the text is not known. Should only be used if you are really looking for Japanese encoding. If you know you have ASCII, then don't waste your time trying to convert.

The encoding method of the text is determined using Ken Lunde's algorithm. For more information, see "Understanding Japanese Information Processing" by Ken Lunde from O'Reilly & Associates, ISBN 1-56592-043-0.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
JapaneseConverter()
          Empty constructor.
 
Method Summary
 java.lang.String convert(byte[] pValue, java.lang.String pEncoding)
          Converts the byte array into a Java UNICODE String.
 java.util.Dictionary convert(java.util.Dictionary pValue, java.lang.String pEncoding)
          Converts all of the keys and values in the supplied dictionary to UNICODE Strings.
 java.lang.String convert(java.lang.String pValue, java.lang.String pEncoding)
          Converts the byte array into a Java UNICODE String.
 java.lang.String getFallbackEncoding()
          The encoding type to use when the actual encoding type of data to convert could not be discerned.
 void setFallbackEncoding(java.lang.String pValue)
          The encoding type to use when the actual encoding type of data to convert could not be discerned.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

JapaneseConverter

public JapaneseConverter()
Empty constructor.

Method Detail

setFallbackEncoding

public void setFallbackEncoding(java.lang.String pValue)
The encoding type to use when the actual encoding type of data to convert could not be discerned. This value should be a String such as, "JIS", "SJIS", or "EUC_JP".

Specified by:
setFallbackEncoding in interface Converter

getFallbackEncoding

public java.lang.String getFallbackEncoding()
The encoding type to use when the actual encoding type of data to convert could not be discerned. This value should be a String such as, "JIS", "SJIS", or "EUC_JP".

Specified by:
getFallbackEncoding in interface Converter

convert

public java.lang.String convert(byte[] pValue,
                                java.lang.String pEncoding)
                         throws java.io.IOException
Converts the byte array into a Java UNICODE String.

The passed in encoding is ignored. This class is designed to look at the data to convert and attempt to discern the encoding of the data.

Specified by:
convert in interface Converter
Throws:
java.io.IOException

convert

public java.lang.String convert(java.lang.String pValue,
                                java.lang.String pEncoding)
                         throws java.io.IOException
Converts the byte array into a Java UNICODE String. This method assumes that the native text only occupies the low bytes of the String, i.e. the high bytes in the supplied String will be dropped.

The passed in encoding is ignored. This class is designed to look at the data to convert and attempt to discern the encoding of the data.

Specified by:
convert in interface Converter
Throws:
java.io.IOException

convert

public java.util.Dictionary convert(java.util.Dictionary pValue,
                                    java.lang.String pEncoding)
                             throws java.io.IOException
Converts all of the keys and values in the supplied dictionary to UNICODE Strings. The method assumes that the keys and values are both Strings to begin with.

The passed in encoding is ignored. This class is designed to look at the data to convert and attempt to discern the encoding of the data.

Specified by:
convert in interface Converter
Throws:
java.io.IOException