[PATCH 3/3] msxml3: Don't force UTF-8 when saving XML document.

Nikolay Sivov nsivov at codeweavers.com
Mon Mar 22 07:10:21 CDT 2021


On 3/19/21 6:25 PM, Dmitry Timoshkov wrote:
> This is the only place where xmlSaveToIO() is forced to use UTF-8 for an
> output document, other places specify NULL for the default encoding.

It's because get_xml() and save() are different. UTF-8 is used together
with bstr_from_xmlChar().

>
> This doesn't completely fix the saved XML contents, but at least XML document
> has proper encoding now.

What is the proper encoding if output is always in WCHARs?

>
> Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
> ---
>  dlls/msxml3/domdoc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c
> index a81ef5f16cb..49596999d16 100644
> --- a/dlls/msxml3/domdoc.c
> +++ b/dlls/msxml3/domdoc.c
> @@ -1405,7 +1405,7 @@ static HRESULT WINAPI domdoc_get_xml(
>          return E_OUTOFMEMORY;
>  
>      options = XML_SAVE_FORMAT | XML_SAVE_NO_DECL;
> -    ctxt = xmlSaveToIO(domdoc_get_xml_writecallback, NULL, buf, "UTF-8", options);
> +    ctxt = xmlSaveToIO(domdoc_get_xml_writecallback, NULL, buf, NULL, options);
>  
>      if(!ctxt)
>      {
Correct way to fix formatting and encoding issues is to reimplement node
dumping functionality in msxml itself.



More information about the wine-devel mailing list