commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <>
Subject Re: Handling text encodings
Date Mon, 18 Nov 2002 16:00:42 GMT

On Mon, 18 Nov 2002, Tim O'Brien wrote:

> The codec package is very simple.  Right now it contains 3 encoders
> specifically geared towards language ( Soundex, RefinedSoundex, and
> Metaphone ).  It also contains a Base64 encoder and decoder.
> There is only one interface "Encoder" with one method  "public
> String encode(String pString)".  I think we need another interface
> "Decoder", with a similarly simple interface "public String decode(String
> pString)".
> Soundex, RefinedSoundex, and Metaphone are all one way Encoders, there is
> no way to "Decode" from these algorithms.  Punycode, Bootstring, and
> Base64 are encoding and decoding algorithms, so I see the need for another
> Decoder algorithm.

How about adding in a OneWay and TwoWay interfaces for Encoder and
Decoder. Probably as extensions of Enc/Dec.

TwoWayEncoder would have a getDecoder method. Returning either a Decoder
or a Class.
OneWay would just be a marker.

If a Class, then EncoderUtils could be used to get a Decoder for an

Just ideas :)


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message