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

  • SEARCH
  • Home
  • 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 8141803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:38:03+00:00 2026-06-06T12:38:03+00:00

Hoi! I trying to make a webservice in Windows. The client is Delphi 6,

  • 0

Hoi!

I trying to make a webservice in Windows.

The client is Delphi 6, with MSXML2.XMLHTTP call, and other side is PHP.

First I tested: can I receive hungarian XML?

The PHP source was UTF-8 encoded file (PSPAD).

$s = 'alma árvíztűrő tükörfúrógép beta';
$doc = new DOMDocument('1.0', 'utf-8');
$doc->formatOutput = true;
$m = $doc->createElement('package');
$doc->appendChild($m);
$n = $doc->createElement('Msg');
$m->appendChild($n);
$n->nodeValue = $s;
$xs = $doc->saveXML();
header('Content-Type: text/xml');
echo($xs);

This package I fully got in Delphi side, the accents are ok.

So then I tried to inject data from xml (post xml to php with accents).

global $HTTP_RAW_POST_DATA;
$xmlstr = $HTTP_RAW_POST_DATA;
$xml = new SimpleXMLElement($xmlstr);
$msg = $xml->msg;
#$msg = 'ÁRVÍZTŰRŐ TÜKÖRFÚRÓGÉP';

Ok, I got the “msg” field, but nevertheless I trying to convert it, everytime I got some convert notice, and the result is not same as when I set the variable directly…

The debug is:

echo(utfCharToNumber($sinput).'<br>');
echo(utfCharToNumber($sdefined).'<br>');

Input:   195[   ]8286195141908419717682197[   ]328419
Defined: 195[129]8286195141908419717682197[144]328419
Input:   5156751951508270195154821951477119513780<br>
Defined: 5156751951508270195154821951477119513780<br>

As you see that two holes I have in the variable when I converted the input from MSXML2.

I really don’t understand this.

I cannot reproduce same XML output from get the data from input XML as when I set directly in PHP code…

Why?

Thanks for your every help, idea, link, document, little example!

dd

  • 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-06-06T12:38:05+00:00Added an answer on June 6, 2026 at 12:38 pm

    The source of the problem was the Delphi code.

    Priorly I used AnsiToUTF8 to encode the XML text.
    But the COM object is uses UTF16 as I think.

    The working code is this:

    procedure TForm1.Button4Click(Sender: TObject);
    var
        mhttp : variant;
        ws : WideString;
        tosend : OleVariant;
        xml : TXMLDocument;
        n : IXMLNode;
    begin
        mhttp := CreateOleObject('MSXML2.XMLHTTP');
        mhttp.Open('POST', 'http://127.0.0.1/test_xmlgen.php', False);
    
        xml := CreateANewDocument(Self, '', 'a');
        n := xml.DocumentElement.AddChild('msg');
        n.NodeValue := 'ÁRVÍZTŰRŐ TÜKÖRFÚRÓGÉP';
        xml.SaveToXML(ws);
        tosend := ws;
    
        mhttp.send(tosend);
        Memo1.Lines.Text :=
            IntToStr(mhttp.Status) + #13 +
            mhttp.responseText + #13;
    end;
    

    This can resend the XML I sent – with good accents.

    Thanks for your help:
    dd

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

Sidebar

Related Questions

Hoi. I am working on an experiment allowing users to use 1% of my
Say I have html similar to the following <ul> <li> hi </li> <li> hoi
Ah-hoi, hoi, I'm wondering if it's ok to do something like the following: class
I'm working on a translation function that should work like this: _('{en:}hello{nl:}hoi') But I'm
I am trying to implement the simplest shared 'files' folder for a website but
Hoi! I have a form I wish to submit, but I need to add
Hi my html looks like this: <ul class=first> <li> <div class=tg-hey>hey</div> <div class=tg-hi>hi</div> <div
Hoi. I love Eclipse. But i hate that huge square annotation on the left,
Hoi, for example, i have a xml file : <bookstore> <book category=COOKING> <title lang=en>Everyday
Hoi, I have a dynamic library loader, which is written in C++ but provides

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.