Subject: Re: pass chinese string variable between C++ and Prolog

From: Jan Wielemaker <[email-masked]>
Date: Mon, 16 Oct 2000 09:58:07 +0200

On Mon, 16 Oct 2000, Stephen wrote:

>Now i meet a question about C++ calling Prolog,  Can anybody help me?
>
>Question is
>I put a english string to Prolog variable( from ), and then get this string from it, the result is right. just as follows:
>
>	SP_term_ref from;
>	SP_put_string(from = SP_new_term_ref(), "country");
>	char* lp2 = NULL;
>	int nRet = SP_get_string(from,&lp2);
>
>But i put a chinese string to the variable (from), and then get the string, the return value (nRet) is 1, the point lp2 is "[]",
>	
>	SP_term_ref from;
>	SP_put_string(from = SP_new_term_ref(), "×æ¹ú");
>	char* lp2 = NULL;
>	int nRet = SP_get_string(from,&lp2);
>
>What happened and What can i do for it?

Aren't you mixing up mailinglists?  This looks like a SICStus Prolog
problem to me :-)

	Regards --- Jan