Patrick Doyle <[EMAIL PROTECTED]> writes:

> What is the best way for a JVM to instantiate a String for a constant pool
> entry of type "CONSTANT_String"?  I'm looking for the most straightforward
> approach that won't cause me a lot of grief down the road.  There are a
> number of constructors for String; should I use one of those, or just use
> my inside knowledge of the String class to construct an instance manually?
> 
> The closest thing to sanity I can think of is to convert the UTF8-encoded
> characters into a char array and then use the String(char[], length)
> constructor.  AFAIK I would have to implement the conversion myself.
> 
> Does this seem like the right approach?

I don't know if this matters, but your approach seems to ignore locale
encoding.

Brian
-- 
Brian Jones <[EMAIL PROTECTED]>

_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to