public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
From: "gruni dot ca at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: java-prs@gcc.gnu.org
Subject: [Bug java/21068] New: String(strBytes, "UTF-16LE"); thorws java.io.UnsupportedEncodingException
Date: Sun, 17 Apr 2005 12:41:00 -0000	[thread overview]
Message-ID: <20050417124104.21068.gruni.ca@gmail.com> (raw)

The constructor String(strBytes, "UTF-16LE"); throws a
UnsupportedEncodingException which is not logical, becasue the Charset is
supported according to Charset.availableCharsets()
TestCase will follow. This is my output

Available Charsets are:
{ISO-8859-1=ISO-8859-1, US-ASCII=US-ASCII, UTF-16=UTF-16, UTF-16BE=UTF-16BE,
UTF-16LE=UTF-16LE, UTF-8=UTF-8}
Exception in thread "main" java.io.UnsupportedEncodingException: UTF-16LE
(java.lang.ClassNotFoundException: gnu.gcj.con
vert.Input_UnicodeLittle not found in
gnu.gcj.runtime.SystemClassLoader{urls=[file:.\], parent=gnu.gcj.runtime.VMClassLo
ader{urls=[core:/], parent=null}})
   at GcjStringTest.main(java.lang.String[])
(E:\2004-development\2005-extraextra\src\GcjStringTest.java)
   at ._main (C:\DOKUME~1\GRUNEW~1\LOKALE~1\Temp\ccM5baaa.i)

And accoring to the APIdocs:

String

public String(byte[] bytes,
              String charsetName)
       throws UnsupportedEncodingException

    Constructs a new String by decoding the specified array of bytes using the
specified charset. The length of the new String is a function of the charset,
and hence may not be equal to the length of the byte array.

    The behavior of this constructor when the given bytes are not valid in the
given charset is unspecified. The CharsetDecoder class should be used when more
control over the decoding process is required.

Parameters:
    bytes - the bytes to be decoded into characters
    charsetName - the name of a supported charset 
Throws:
    UnsupportedEncodingException - If the named charset is not supported
Since:
    JDK1.1 

The charset should be taken out of the Charsets class.

So ya this is a bug in my eyes.

Regards,

Andreas

-- 
           Summary: String(strBytes, "UTF-16LE"); thorws
                    java.io.UnsupportedEncodingException
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gruni dot ca at gmail dot com
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21068


             reply	other threads:[~2005-04-17 12:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-17 12:41 gruni dot ca at gmail dot com [this message]
2005-04-17 12:43 ` [Bug java/21068] " gruni dot ca at gmail dot com
2005-04-17 14:37 ` [Bug libgcj/21068] " pinskia at gcc dot gnu dot org
2005-04-17 14:42 ` pinskia at gcc dot gnu dot org
2005-04-17 15:21 ` ovidr at users dot sourceforge dot net
2005-04-17 17:27 ` gruni dot ca at gmail dot com
2005-07-15 21:41 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050417124104.21068.gruni.ca@gmail.com \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=java-prs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).