Hi

Information about this, including me leaving it in PD and links for
download can be found here:
http://ola-bini.blogspot.com/2006/06/java-charsets.html

Regards
 Ola Bini

----- Original Message -----
From: Ola Bini <[EMAIL PROTECTED]>
Date: Thursday, June 15, 2006 9:33 pm
Subject: Re: [Jruby-devel] New Zlib.
To: jruby-devel@lists.sourceforge.net

> Heh, of course they have to be asked. =) Don't worry, there are no
> licensing, no copyright, nothing at all. I'll public domain it and put
> the source up somewhere. The big problem for JRuby is that it's a
> classic SPI, so it must reside in it's own jar-file and all that 
> stuff,so I didn't know how I would handle this inside the JRuby 
> source tree.
> 
> /O
> 
> ----- Original Message -----
> From: Charles O Nutter <[EMAIL PROTECTED]>
> Date: Thursday, June 15, 2006 9:23 pm
> Subject: Re: [Jruby-devel] New Zlib.
> To: jruby-devel@lists.sourceforge.net
> 
> > It sounds like a good enough solution for now, especially given 
> the 
> > slowpace at which anyone in Ruby-land is moving toward a uniform 
> > unicodestandard. I'm sure Tom would raise the licensing question 
> at 
> > this point, so
> > I'll do it for him...is this a gift to JRuby or what license is 
> it 
> > releasedunder? (four classes, I know, but these questions have to 
> > be asked...)
> > 
> > On 6/15/06, Ola Bini <[EMAIL PROTECTED]> wrote:
> > >
> > > Ah, yes, plaincharset. =)
> > >
> > > That's basically a VERY small (4 classes) Charset, which I use 
> to go
> > > from byte[] to Java Strings without having to fuzz with the 
> > translation.> I'm going to write about this in my blog tonight, 
> but 
> > anyway, here's the
> > > short story:
> > > char[] cs = new char[256];
> > > for(int i=0;i<cs.length;i++) {
> > >   cs[i] = (char)i;
> > > }
> > > String str = String.valueOf(cs);
> > > byte[] bts = str.getBytes(); // or str.getBytes("ASCII"); or
> > > str.getBytes("UTF-8");
> > > for(int i=0;i<256;i++) {
> > > System.err.println("chr: " + (int)cs[i] + " byte: " + bts[i]);
> > > }
> > >
> > >
> > > What you will notice is a few places in the middle - different 
> > depending> on the encoding you choose when getting bytes - where 
> > the bytes are 63,
> > > regardless of the char. This means that we cannot use this to 
> > represent> all bytes when we want to get at the underlying bytes. 
> > What plaincharset
> > > does is (and it does it pretty fast) translate between char[] 
> and 
> > byte[]> arrays such that for i in 0..255 byte[i] == (byte)char[i];
> > >
> > > I need it desperately to handle IO work between Ruby-world and
> > > Java-world, and it's probably useful in other places too. Use the
> > > encoding named "PLAIN" and it just works (if plaincharset.jar 
> is 
> > on the
> > > classpath).
> > >
> > > Regards
> > > Ola Bini
> > >
> > > ----- Original Message -----
> > > From: Charles O Nutter <[EMAIL PROTECTED]>
> > > Date: Thursday, June 15, 2006 9:10 pm
> > > Subject: Re: [Jruby-devel] New Zlib.
> > > To: jruby-devel@lists.sourceforge.net
> > >
> > > > What's plaincharset?
> > > >
> > > > On 6/15/06, Ola Bini <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > Hi,
> > > > >
> > > > > So here comes the new (partial) Zlib implementation. I've 
> > totally> > > rewritten GzipReader and GzipWriter in Java. There 
> are 
> > a few
> > > > steps to
> > > > > get this working, though. First, the new files:
> > > > >
> > > > > plaincharset.jar -> lib/
> > > > > zlib.rb          -> src/builtin    (this is very important)
> > > > > RubyZlib.java    -> org/jruby
> > > > > ZlibLibrary.java -> org/jruby/libraries
> > > > >
> > > > > src/lib/ruby/1.8/zlib.rb should be removed
> > > > >
> > > > > My new RubyStringIO and company is needed for this to work.
> > > > >
> > > > > and the patch should be applied. but that is a slight 
> > problem, since
> > > > > some of my previous updates have been catched by this patch 
> too,> > > > especially the StringIO-stuff and the Signal things.
> > > > >
> > > > > ... oh, and yeah, if you're using windows, you have to 
> modify 
> > the> > bat> script to reference everything in lib/*.jar in your 
> > classpath,> > not just
> > > > > jruby.jar
> > > > >
> > > > > ... I hope this is all, good luck and please come back with
> > > > comments!>
> > > > > /O
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > Jruby-devel mailing list
> > > > > Jruby-devel@lists.sourceforge.net
> > > > > https://lists.sourceforge.net/lists/listinfo/jruby-devel
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Charles Oliver Nutter @ headius.blogspot.com
> > > > JRuby Developer @ jruby.sourceforge.net
> > > > Application Architect @ www.ventera.com
> > > >
> > >
> > >
> > > _______________________________________________
> > > Jruby-devel mailing list
> > > Jruby-devel@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/jruby-devel
> > >
> > 
> > 
> > 
> > -- 
> > Charles Oliver Nutter @ headius.blogspot.com
> > JRuby Developer @ jruby.sourceforge.net
> > Application Architect @ www.ventera.com
> > 
> 
> 
> _______________________________________________
> Jruby-devel mailing list
> Jruby-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jruby-devel
> 


_______________________________________________
Jruby-devel mailing list
Jruby-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jruby-devel

Reply via email to