classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: character converter (Re: current work)


From: Dalibor Topic
Subject: Re: character converter (Re: current work)
Date: Mon, 25 Jun 2001 23:30:51 +0200

Am Montag, 25. Juni 2001 21:06 schrieben Sie:
> Tom Tromey wrote:
> > I agree.  This is a tricky area though, and the libgcj code is
> > undergoing some discussion.  For instance we discovered that the
> > String(byte[]) constructor was creating too much garbage if you
> > converted a large number of strings.  That's because it was creating a
> > new converter for each string.  So now we're looking at a way to reuse
> > converters (the patch isn't in yet but probably will be soon).

Given that some encodings are stateless, wouldn't it be better to just use a 
single static instance for those?

> If you are looking into redisigning converters a bit, please take a look
> at jdk 1.4 java.nio.charset package. It works on Buffers, so is not
> directly usable, but it might be nice to create encoders/decoders so
> they could be used later for nio.charset without big change. There is
> also one idea I like there - each converter has averageBytesPerChar
> float variable, which is a hint for internal allocations.

The current CVS version of Kaffe has got a converter implementation by 
Edouard G. Parmelan that uses iconv, so you might like to check that out as 
well. They also have a tool that automatically goes through the i18n maps and 
generates Java converters.

bye,

Dalibor Topic

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]