Simple conversion?

Jeff Sturm jeff.sturm@appnet.com
Thu Oct 5 07:29:00 GMT 2000


Torsten Rüger wrote:
> how do I get a "C" char*
> from a ::java::lang::String

You can use JvGetStringUTFRegion(). See the CNI docs:
http://sources.redhat.com/java/papers/cni/t1331.html
(Strictly speaking, this method produces a char* encoded as UTF-8. That's only
one way to convert Unicode to a C string.)
> respectively, what is a __java_char and a __java_byte on my machine
> (linux-pc). More importantly though, where is this defined ?

They are the internal names for `jchar' and `jbyte', respectively, which are the
same size as the corresponding Java types. (These and other types are defined
in javaprims.h.)
--
Jeff Sturm
jeff.sturm@commerceone.com


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /