Unicode across the network to xml
<p>I'm trying to figure out the safest way to retrieve unicode data in a unified method from remote computers and make sure that data stays consistent and readable.</p>

<p>Computer A: Chinese user, mixed English Windows 7, some registry values contain Chinese letters like L"您好"</p>

<p>Computer B: US English, no unicode values returned from my functions</p>

<p>Computer C: Introduces an agent to Computer A and B.  </p>

<p>The agent: assesses the health and security of the computer from the inside.  One unicode aware section is simply getting registry values i.e:</p>

<pre><code>int Utilities::GetRegistryStringValue(HKEY h_sub_key, WCHAR* value_name, wstring &amp;result)
{
DWORD cbData = 8;
LPDWORD type = NULL;

//Get the size and type of the key
long err = RegQueryValueEx(h_sub_key, value_name, NULL, type, NULL, &amp;cbData);

if (err != ERROR_SUCCESS)
{
    if (err != ERROR_FILE_NOT_FOUND)
        debug-&gt;DebugMessage(Error::GetErrorMessageW(err));
    return err;
}

result.resize(cbData / sizeof(WCHAR));

LPWSTR res = new WCHAR[(cbData + sizeof(L'\0')) / sizeof(WCHAR)];

err = RegQueryValueEx(h_sub_key, value_name, NULL, NULL, (LPBYTE) &amp;res[0], &amp;cbData);

if(err != ERROR_SUCCESS &amp;&amp; err != ERROR_FILE_NOT_FOUND)
{
    debug-&gt;DebugMessage(Error::GetErrorMessageW(err));
    return err;
}

res[cbData / sizeof(WCHAR)] = L'\0';

result = wstring(res);

return ERROR_SUCCESS;
</code></pre>

<p>}</p>

<p>Those values will be stored in an XML file.
Should that XML file be in UTF16 or UTF8?
Am I going to need to pass the remote system's code page back for translation?
What other issues might I have?</p>
