yilmaz ay wrote:
>
> >   I'm sorry if this is too basic, I might not be
> >  understanding your problem, but: Do you understand
> >  what an exception is? And what it means to 'catch' an
> >  exception?
> >
> error message is in chinese, though from
> java.io.UnsupportedEncodingException  it is obvious
> that the problem is with encoding.
>

 No, the compile-time problem is that you're not
catching an exception. If you catch the exception
(by putting the line of code inside a try/catch
block), then your code will compile and the error
message will go away.


> Even if the exception would have been caught  and the
> compilation were succesful, still it wouldn't be able
> to handle big5 chars ,right ?
>

 A quick check of the JDC bug list indicates that
Big5 does in fact work (but might have a couple of
problems with certain Taiwanese characters.)

 What exactly gave you the impression that Big5 wasn't
supported at all in 1.3?


 Random advice:

 1) Find out _exactly_ what bytes are being sent over
    the wire in the request. Write them down and hand-check
    what they mean, make sure they really are Big5, etc.
    Doing this will also allow you to recognize the byte
    sequence if you see it again.

 2) Where is 'name'? Is it a parameter in a GET? If so,
    you need to be careful, ref:
      http://java.sun.com/j2se/1.3/relnotes.html 'Networking'
    and
      http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.2.1

 3) If you haven't already, check out:
      http://java.sun.com/j2se/1.3/docs/guide/intl/index.html
    and especially:
      http://java.sun.com/j2se/1.3/docs/guide/intl/encoding.doc.html

 4) Write a tiny test program where you take a Big5
    encoded String and add it to the database. Does
    it work? If so, then you've reduced your problem
    by half.

 5) Use SnoopServlet to take a look at the request. What
    does it look like? Write your own tiny servlet that
    just prints out the params. Are they in Chinese, or
    is the servlet container even handing you the correct
    strings? What _is_ the container handing to you?

 6) Print out the bytes (as ints, not chars) you get from
    String.getBytes(). Are they the bytes from #1, or
    are they different?

 7) If none of that proves enlightening, and you're using
    a POST instead of a GET, then read the body of the
    request yourself, using an InputStream. What do the
    bytes look like? Are they the bytes from #1? If so,
    then combined with #4, you're set. Probably this
    isn't necessary if you get everything else right,
    but hey, at least you'll know it's possible...


--
Christopher St. John [EMAIL PROTECTED]
DistribuTopia http://www.distributopia.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to