Commit 6bef4da5 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

vbscript: Use current locale in to_string.

parent 2be12eac
...@@ -124,26 +124,16 @@ static HRESULT to_int(VARIANT *v, int *ret) ...@@ -124,26 +124,16 @@ static HRESULT to_int(VARIANT *v, int *ret)
static HRESULT to_string(VARIANT *v, BSTR *ret) static HRESULT to_string(VARIANT *v, BSTR *ret)
{ {
static const WCHAR trueW[] = {'T','r','u','e',0}; VARIANT dst;
static const WCHAR falseW[] = {'F','a','l','s','e',0}; HRESULT hres;
switch(V_VT(v)) { V_VT(&dst) = VT_EMPTY;
case VT_BOOL: hres = VariantChangeType(&dst, v, VARIANT_LOCALBOOL, VT_BSTR);
*ret = SysAllocString(V_BOOL(v) ? trueW : falseW); if(FAILED(hres))
return *ret ? S_OK : E_OUTOFMEMORY; return hres;
default: {
VARIANT dst;
HRESULT hres;
V_VT(&dst) = VT_EMPTY;
hres = VariantChangeTypeEx(&dst, v, MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT), 0, VT_BSTR);
if(FAILED(hres))
return hres;
*ret = V_BSTR(&dst); *ret = V_BSTR(&dst);
return S_OK; return S_OK;
}
}
} }
static IUnknown *create_object(script_ctx_t *ctx, const WCHAR *progid) static IUnknown *create_object(script_ctx_t *ctx, const WCHAR *progid)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment