Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7690717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:27:35+00:00 2026-05-31T20:27:35+00:00

I don’t seem to understand the purpose of XMLString::transcode(XMLCh*) and XMLString::transcode(char*) , because obviously

  • 0

I don’t seem to understand the purpose of XMLString::transcode(XMLCh*) and XMLString::transcode(char*) , because obviously I don’t understand the difference between XMLCh* and char*.
Can someone please make things clearer for me ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T20:27:36+00:00Added an answer on May 31, 2026 at 8:27 pm

    Xerces encodes information as UTF-16 internally. The UTF-16 data is stored using the XMLCh datatype.

    ‘C-style’ strings use char which is in the local code page (probably UTF-8, but it depends on the platform and settings) You use transcode to convert between the two.

    For instance if you want to feed some data from Xerces to another library and that library expects text in the local code page, you need to transcode it. Also, if you have char data and want to feed it to Xerces, you need to transcode it to XMLCh, because that is what Xerces understands.

    For example:

    // to local code page
    DOMNode *node = ...;
    char* temp = XMLString::transcode(node->getNodeValue()); 
    std::string value(temp);
    XMLString::release(&temp); 
    
    // from local code page
    DOMElement *element = ...;
    XMLCh *tag = XMLString::transcode("test");
    DOMNodeList *list = element->getElementsByTagName(tag);
    XMLString::release(&tag);
    

    Do not forget to release the string! Better is to write some wrapper round it but there are examples available on the internet (just search for a class named XercesString).

    If you want to know more about encodings I think you should read The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Don't ask me why but i can't use this method because I need to
Don't think this is a repost, difficult to search for the word between because
Don't think that I'm mad, I understand how php works! That being said. I
Don't know if anyone can help me with this or if it's even possible.
Don't have much to say, just can get into the event handler. XAML: <Grid>
don't understand: in my controller: @json = User.all.to_gmaps4rails do |user| \Title\: \#{user.email}\ end in
Don't understand, if Data.Map is and [] is. I found this out while wondering
Don't know why I can't reply to people on here with only a small
Don't quite understand determinism in the context of concurrency and parallelism in Haskell. Some
Don't know why but I can't find a solution to this. I have 3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.