OK. I have added the patch to the GenericElement.
... and your test example Santago works very well now.

Cheers,

Krzysztof


Santiago Gala wrote:
> 
> Jon Stevens wrote:
> 
> > on 11/20/2000 7:27 AM, "Krzysztof Zelazowski" <[EMAIL PROTECTED]>
> > wrote:
> >
> > > I will be glad to submit a patch for it...
> >
> > Yes, please do as so far, I don't like Santiago's patch and I do see how
> > this is a problem.
> >
> 
> Could you, at least, use the test case that I sent for the ecs test cases?
> 
> I would like to ensure that multibyte character handling works after whatever
> patch is applied.
> 
> As the test case has not been submitted to this list, I send it again here:
> 
> import org.apache.ecs.*;
> 
> /**
>  * Test for multibyte character handling in ECS
>  * @author <A HREF="mailto:[EMAIL PROTECTED]">S. Gala</A>
>  */
> public class TestECSPrinting {
> 
> public static void main( String[] argv ) {
> 
>  String test = "" + (char)0x0432; // Small RUSSIAN B in Unicode
>  StringElement testecs = new StringElement(test);
>  if( test.indexOf( test ) >= 0 )
>     System.err.println("It contains SMALL RUSSIAN B before");
>  if( testecs.toString().indexOf( test ) >= 0 )
>     System.err.println("It contains SMALL RUSSIAN B after toString()");
>  if( testecs.toString("utf-8").indexOf( test ) >= 0 )
>     System.err.println("It contains SMALL RUSSIAN B after toString(\"utf-8\")");
> 
>  }
> 
> }
> 
> As far as I know, the three tests should succeed, no matter the parameter you
> pass to the toString(). A String is a String, no matter the encoding. Encodings
> belong to bytes, and I don't want bytes in a toString() method. If the
> StringElement used bytes internally, it would make sense, but in this case you
> would have to specify the encoding in the constructor, to enable the system to
> store the bytes internally.
> 
> Regards,
>     Santiago
> 
> --
> 
> A String, by any other name, would contain the same characters?
> 
> >
> > thanks,
> >
> > -jon
> >
> > --
> > twice of not very much is still a lot more than not very much
> >
> > --
> > ------------------------------------------------------------
> > To subscribe:        [EMAIL PROTECTED]
> > To unsubscribe:      [EMAIL PROTECTED]
> > Archives and Other:  <http://java.apache.org/main/mail.html>
> > Problems?:           [EMAIL PROTECTED]
> 
> --
> ------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Archives and Other:  <http://java.apache.org/main/mail.html>
> Problems?:           [EMAIL PROTECTED]


--
------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to