Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > CharsetEncoder for UTF-16 canEncode('\ufffe') is a bug?

Reply
Thread Tools

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

 
 
Harald Kirsch
Guest
Posts: n/a
 
      06-28-2004
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.
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      06-28-2004
On 28 Jun 2004 02:41:47 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) (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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments