[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gzz-commits] gzz/gfx/jni GzzGL-jni.cxx
From: |
Tuukka Hastrup |
Subject: |
Re: [Gzz-commits] gzz/gfx/jni GzzGL-jni.cxx |
Date: |
Fri, 27 Sep 2002 13:24:44 +0300 (EEST) |
On Fri, 27 Sep 2002, Antti-Juhani Kaijanaho wrote:
> On 20020927T014516-0400, Asko Soukka wrote:
> > + /** Converts std::string to jstring through UTF-8 transformation */
> > + jstring stdstr2jstr(JNIEnv *env, std::string stdstr) {
> > + return env->NewStringUTF(stdstr.data());
> > }
>
> As I recall, std::string::data does not null-terminate its content.
> How does NewStringUTF know the length of the data?
I wonder the same thing. I think the call should be
NewStringUTF(stdstr.c_str()) instead. In the case of unistring, data()
should be enough as the conversion function takes the length as second
argument.
--
-- Trying to catch me? Just follow up my Electric Fingerprints
-- To help you: address@hidden
http://www.iki.fi/Tuukka.Hastrup/
IRCNet: Stugge/tuukkah @#pii,#gzz,#ynna
Jabber ID: address@hidden, ICQ #11321669
- [Gzz-commits] gzz/gfx/jni GzzGL-jni.cxx, Tuomas J. Lukka, 2002/09/04
- [Gzz-commits] gzz/gfx/jni GzzGL-jni.cxx, Tuomas J. Lukka, 2002/09/18
- [Gzz-commits] gzz/gfx/jni GzzGL-jni.cxx, Tuomas J. Lukka, 2002/09/23
- [Gzz-commits] gzz/gfx/jni GzzGL-jni.cxx, Asko Soukka, 2002/09/25
- [Gzz-commits] gzz/gfx/jni GzzGL-jni.cxx, Matti Katila, 2002/09/25
- [Gzz-commits] gzz/gfx/jni GzzGL-jni.cxx, Asko Soukka, 2002/09/27
- [Gzz-commits] gzz/gfx/jni GzzGL-jni.cxx, Asko Soukka, 2002/09/27
- [Gzz-commits] gzz/gfx/jni GzzGL-jni.cxx, Asko Soukka, 2002/09/27
- [Gzz-commits] gzz/gfx/jni GzzGL-jni.cxx, Asko Soukka, 2002/09/30