Strictly speaking, the issue isn't whether some
double-byte characters are supported. It's whether
all of Unicode is supported. UTF-8, UTF-16, UTF-32
for example - anything mentioned on:
http://en.wikipedia.org/wiki/Comparison_of_Unicode_encodings
... would be legit.
-- Adam
Ryan Lubke said the following on 5/18/07 10:26 AM PT:
> Hey folks,
>
> I'm working on removing the following pending comments from
> c.s.f.util.HtmlUtils:
>
> // Double-byte characters to encode.
> // PENDING: when outputting to an encoding that
> // supports double-byte characters (UTF-8, for example),
> // we should not be encoding
> _writeDecRef(out, ch)
>
> I've come up with:
>
> /**
> * @param encoding a valid encoding
> * @return <code>true</code> if the specified encoding is
> * multi-byte, otherwise <code>false</code>
> */
> static public boolean isEncodingMultiByte(String encoding) {
> Charset c = Charset.forName(encoding);
> return (c.newEncoder().maxBytesPerChar() > 1.0f);
> }
>
> Just curious if anyone had ideas on a better way to handle this detection.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
> For additional commands, e-mail: dev-help_at_javaserverfaces.dev.java.net
>