[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Query Regarding Universal String to store ü



Hi,
I am using a SNACC generated C++ code. I am trying to interface the
generated code with the below code.
My objective is to store a character like "ü" or "ä" in a UniversalString
and retrieve it. But when i try to perform as below , i get an exception
thrown.(given in output)
What is the procedure i shouid perform so that i would be able to store such
characters in UniversalString.
Kindly help.....

	UniversalString ustr;
	char ich[32]="ü";
	char och[32];
	
	try
	{
		ustr.set((const char *)&ich[0]);		
		strcpy((char *)&och[0],ustr.getAsUTF8());
		cout<<och<<endl;

	}
	catch(SnaccException &se)
	{
	  se.getCallStack(std::cout);
	  cout << "Exception thrown" <<se.what()<< endl;
	} 
	catch(exception &e)
	{
	  cout << "Exception thrown : " <<e.what()<< endl;
	}


Output:
asn-stringtype.cpp	665	WideAsnString::set()
Exception ThrownInvalid UTF-8 string


Regds
Kaliraj Kalaichelvan
DISCLAIMER 
This message and any attachment(s) contained here are information that is confidential, proprietary to HCL Technologies 
and its customers. Contents may be privileged or otherwise protected by law. The information is solely intended for the 
individual or the entity it is addressed to. If you are not the intended recipient of this message, you are not authorized to 
read, forward, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, 
please notify the sender immediately by return e-mail and delete it from your computer