You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Agrawal, Vikas (ELS)" <V....@elsevier.co.uk> on 2003/09/18 11:54:32 UTC

How to convert XMLCh* to char*

Hi All,

I want to convert XMLCh* to char*
I am using XMLString::transcode to do that.

EsXMLCh& EsXMLCh::operator=(const XMLCh* const cstr)
{
	destroy();

	created = true;
	//gTranscoder->transcode();
	str = XMLString::transcode(cstr);

	return *this;
}

But unfortunately it is not converting XMLCh* to char* properly when XMLCh*
consists unicode characters as well e.g. "emt production, 4 μM silver
nitrate". Could anybody help me how to do that.

Thanks & Regards
Vikas Agrawal

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: How to convert XMLCh* to char*

Posted by Gareth Reakes <ga...@decisionsoft.com>.
Hi,
	You cannot convert a character that is not represented in the 
range described by your current code page to your current code page. 
Unicode has a vast amount of possible characters, your current code page 
probably does not.


Gareth

On Thu, 18 Sep 2003, Agrawal, Vikas (ELS) wrote:

> Hi All,
> 
> I want to convert XMLCh* to char*
> I am using XMLString::transcode to do that.
> 
> EsXMLCh& EsXMLCh::operator=(const XMLCh* const cstr)
> {
> 	destroy();
> 
> 	created = true;
> 	//gTranscoder->transcode();
> 	str = XMLString::transcode(cstr);
> 
> 	return *this;
> }
> 
> But unfortunately it is not converting XMLCh* to char* properly when XMLCh*
> consists unicode characters as well e.g. "emt production, 4 μM silver
> nitrate". Could anybody help me how to do that.
> 
> Thanks & Regards
> Vikas Agrawal
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 
> 
> 

-- 
Gareth Reakes, Head of Product Development  +44-1865-203192
DecisionSoft Limited                        http://www.decisionsoft.com
XML Development and Services




---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org