Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions lib/Runtime/Library/IntlEngineInterfaceExtensionObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,22 +679,29 @@ namespace Js
char16 normalized[ULOC_FULLNAME_CAPACITY] = { 0 };
size_t normalizedLength = 0;
hr = NormalizeLanguageTag(argString->GetSz(), argString->GetLength(), normalized, &normalizedLength);
if (FAILED(hr))
{
HandleOOMSOEHR(hr);
//If we can't normalize the tag; return undefined.
return scriptContext->GetLibrary()->GetUndefined();
}

retVal = Js::JavascriptString::NewCopyBuffer(normalized, static_cast<charcount_t>(normalizedLength), scriptContext);
#else
AutoHSTRING str;
hr = GetWindowsGlobalizationAdapter(scriptContext)->NormalizeLanguageTag(scriptContext, argString->GetSz(), &str);
DelayLoadWindowsGlobalization *wsl = scriptContext->GetThreadContext()->GetWindowsGlobalizationLibrary();
PCWSTR strBuf = wsl->WindowsGetStringRawBuffer(*str, NULL);
retVal = Js::JavascriptString::NewCopySz(strBuf, scriptContext);
#endif

if (FAILED(hr))
{
HandleOOMSOEHR(hr);
//If we can't normalize the tag; return undefined.
return scriptContext->GetLibrary()->GetUndefined();
}

DelayLoadWindowsGlobalization *wsl = scriptContext->GetThreadContext()->GetWindowsGlobalizationLibrary();
PCWSTR strBuf = wsl->WindowsGetStringRawBuffer(*str, NULL);
retVal = Js::JavascriptString::NewCopySz(strBuf, scriptContext);
#endif

return retVal;
}
Var IntlEngineInterfaceExtensionObject::EntryIntl_ResolveLocaleLookup(RecyclableObject* function, CallInfo callInfo, ...)
Expand Down