× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



This bug was previously reported to Sun.  You haven't mentioned what
version of the JDK you're on so it's difficult to pinpoint without that
information.  It probably involves a high surrogate character (\uD800
through \uDBFF) that is not followed by a low surrogate character as
required by Unicode.

What you might want to do is catch the Error (this is not an Exception
but is an Error) in Inv2PDF.  Then, go character by character and try to
convert each character to a byte.  Something like this:

  try
  {
    byte[] ba = myString.getBytes();
  }
  catch (UnknownError ue)
  {
    ue.printStackTrace();
    for (int i = 0; i < myString.length; i++)
    {
      char thisChar = myString.charAt(i);
      System.err.println("Now converting character " + i + " (" +
thisChar + ") "
            + Integer.toHexString((int) thisChar));
      byte thisByte = ("" + thisChar).getBytes();
      System.err.println("Conversion of character " + i + "
successful");
    }
  }

This should show you what character of the String is causing the
problem.

You might try migrating to a more recent JDK or opening a PMR to ask for
a better message.

HTH,
Gary

> -----Original Message-----
> From: java400-l-admin@midrange.com
> [mailto:java400-l-admin@midrange.com] On Behalf Of Vanja Jovic
> Sent: Wednesday, July 17, 2002 9:26 AM
> To: java400-l@midrange.com
> Subject: Strange exception while dealing with strings
>
>
> Hi, all
>
> this is what I get in string intensive application while
> handling large files. Doesn't happen all the time and doesn't
> happen at the same place. Any ideas?
>
> java.lang.UnknownError
>       sun/io/CharToByteISO8859_1.convert([CII[BII)I+236
> (CharToByteISO8859_1.java:103)
>       sun/io/CharToByteConverter.convertAny([CII[BII)I+27
> (CharToByteConverter.java:142)
>
> java/lang/String.getBytes(Lsun/io/CharToByteConverter;)[B+40
> (String.java:629)
>       java/lang/String.getBytes(Ljava/lang/String;)[B+5
> (String.java:665)
>       Inv2PDF.main([Ljava/lang/String;)V+146 (Inv2PDF.java:91)
>
> It gets worse the higher optimization level it is.
>
> thks,
>
> Vanja
>
>
> __________________________________________________________________
> Your favorite stores, helpful shopping tools and great gift
> ideas. Experience the convenience of buying online with
> Shop@Netscape! http://shopnow.netscape.com/
>
> Get your own FREE, personal Netscape Mail account today at
http://webmail.netscape.com/

_______________________________________________
This is the Java Programming on and around the iSeries / AS400
(JAVA400-L) mailing list To post a message email: JAVA400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l
or email: JAVA400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.