You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Mark R. Diggory" <md...@latte.harvard.edu> on 2004/01/13 18:10:56 UTC

byte[] to ASCII content conversion

In Httpclient there is a Static class primarily for the use of 
converting byte[]'s to ASCII strings and for returning a default 
encoding when the reqeuested encoding is not supported.

Here is an example of the file:

http://jakarta.apache.org/commons/httpclient/xref/org/apache/commons/httpclient/HttpConstants.html

Are there other areas of the Commons where this sort of functionality is 
required? Perhapse this is would be a useful addition to [lang] String 
or CharSet Utilities?

or

Is there a more elegant way that the lang CharSetUtils could be applied 
to this case?

I say this primarily because I've had to use it in codec-multipart to 
support the the String conversion there.

http://cvs.apache.org/viewcvs.cgi/jakarta-commons-sandbox/codec-multipart/src/java/org/apache/commons/codec/multipart/util/Constants.java?rev=1.1&view=markup

A more generic (and reusable) solution might be ssomething wise to apply 
here.

Cheers,
Mark

-- 
Mark Diggory
Software Developer
Harvard MIT Data Center
http://osprey.hmdc.harvard.edu

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


Re: byte[] to ASCII content conversion

Posted by Oleg Kalnichevski <ol...@bluewin.ch>.
Mark,
Coincidentally, we just ended up deprecating HttpConstants class, having
migrated all the relevant functions to a new class named EncodingUtil. I
can't help thinking that Codec may also be a good place for what is now
EncodingUtil in HttpClient. 

Cheers,
Oleg

On Tue, 2004-01-13 at 18:10, Mark R. Diggory wrote:
> In Httpclient there is a Static class primarily for the use of 
> converting byte[]'s to ASCII strings and for returning a default 
> encoding when the reqeuested encoding is not supported.
> 
> Here is an example of the file:
> 
> http://jakarta.apache.org/commons/httpclient/xref/org/apache/commons/httpclient/HttpConstants.html
> 
> Are there other areas of the Commons where this sort of functionality is 
> required? Perhapse this is would be a useful addition to [lang] String 
> or CharSet Utilities?
> 
> or
> 
> Is there a more elegant way that the lang CharSetUtils could be applied 
> to this case?
> 
> I say this primarily because I've had to use it in codec-multipart to 
> support the the String conversion there.
> 
> http://cvs.apache.org/viewcvs.cgi/jakarta-commons-sandbox/codec-multipart/src/java/org/apache/commons/codec/multipart/util/Constants.java?rev=1.1&view=markup
> 
> A more generic (and reusable) solution might be ssomething wise to apply 
> here.
> 
> Cheers,
> Mark


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