Why copy Utf8Consts?

Per Bothner per@bothner.com
Sun Feb 17 21:13:00 GMT 2002

Bryce McKinlay wrote:
> Why does _Jv_NewStringUtf8Const() copy the UTF8 data when initializing a 
> String from a Utf8Const? Isn't a Utf8Const essentially a java string 
> without the object/vtable header?

But the characters in a Utf8Const are in variable-width pseudo-UTF8
encoding.  the characters in a Strin use UTF-16 - i.e. 16 bits per
character (ignoring surrogates).
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/

More information about the Java mailing list