Configure StringNormalizer default_locale for _APPLE_ system (#17339)

### Description
<!-- Describe your changes. -->

As title.

iOS language code uses different syntax for specifying language
code/region code:
https://developer.apple.com/documentation/xcode/choosing-localization-regions-and-scripts

current `default_locale` is not working for iOS.


### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->

Issue:
https://github.com/microsoft/onnxruntime/issues/17017

---------

Co-authored-by: rachguo <rachguo@rachguos-Mini.attlocal.net>
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
This commit is contained in:
Rachel Guo 2023-09-14 10:58:25 -07:00 committed by GitHub
parent 7af2f68ef3
commit e11849e716
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -201,7 +201,16 @@ class Utf8Converter {
#endif
const std::string default_locale("en_US.UTF-8"); // All non-MS
#if defined(__APPLE__)
#include <TargetConditionals.h>
#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
const std::string default_locale("en-US.UTF-8");
#else
const std::string default_locale("en_US.UTF-8"); // Other kinds of Apple Platforms including MacOS, etc
#endif
#else
const std::string default_locale("en_US.UTF-8"); // All non-MS and not Apple
#endif
#endif // _MSC_VER