CharsetEncoder for UTF-16 canEncode('\ufffe') is a bug?

Discussion in 'Java' started by Harald Kirsch, Jun 28, 2004.

  1. Hi,

    in SUN's bug database I see that canEncode has quite
    a few entries recently. By chance I stumbled myself
    over this one just now

    Charset.forName("UTF-16").newEncoder().canEncode('\ufffe');

    returns true. The unicode spec says that FFFE is not
    a character, so I would have expected this to be false.

    Any ideas?

    Harald.
     
    Harald Kirsch, Jun 28, 2004
    #1
    1. Advertising

  2. Harald Kirsch

    Roedy Green Guest

    On 28 Jun 2004 02:41:47 -0700, (Harald Kirsch) wrote
    or quoted :

    >returns true. The unicode spec says that FFFE is not
    >a character, so I would have expected this to be false.


    If you disagree with its definition of encodable, you can put a
    wrapper around it to deal with your exception.

    At least you can fix it. canDisplay is irretrievably broken by
    returning true for any no space blob it puts up.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Jun 28, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JJBW
    Replies:
    1
    Views:
    10,216
    Joerg Jooss
    Apr 24, 2004
  2. =?Utf-8?B?QXNoYQ==?=
    Replies:
    3
    Views:
    429
  3. Arifi Koseoglu
    Replies:
    2
    Views:
    982
    Arifi Koseoglu
    Apr 13, 2004
  4. Jimmy Shaw

    Converting from UTF-16 to UTF-32

    Jimmy Shaw, Jul 31, 2006, in forum: C++
    Replies:
    7
    Views:
    1,341
    P.J. Plauger
    Aug 1, 2006
  5. Replies:
    2
    Views:
    386
    Nathan Keel
    Aug 14, 2009
Loading...

Share This Page