> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 支援的 NLS 函式

> 參考 GDK 中 WINAPI_PARTITION_GAMES 下可用的國家語言支援 (NLS) 函式,以及 XBOX Game OS 的注意事項與使用說明。

國家語言支援 (NLS) 函式可協助遊戲支援特定語言與地區設定的行為。在 XBOX 上只能使用 `WinNLS.h` 中定義於 `WINAPI_PARTITION_GAMES` 分割區下的 API 函式。

<Note>
  標示為 **DEPRECATED** 的 API 在 GDK 上仍可運作,但有 Microsoft Docs 上所記載的注意事項。建議使用替代項目。
</Note>

## 可用的函式

| 函式 | 狀態 | 替代項目 |
| - | - | - |
| `EnumSystemLocalesEx` | | |
| `FindNLSStringEx` | | |
| `FoldStringA` | | |
| `GetACP` | | |
| `GetCurrencyFormatEx` | | |
| `GetGeoInfoEx` | | |
| `GetLocaleInfoEx` | | |
| `GetNumberFormatEx` | | |
| `GetStringTypeA` | | |
| `GetStringTypeExA` | | |
| `GetThreadLocale` | | |
| `GetUserDefaultGeoName` | | |
| `GetUserDefaultLocaleName` | | |
| `GetUserPreferredUILanguages` | NOT SUPPORTED | 一律傳回 `en-US` |
| `IdnToAscii` | | |
| `IdnToUnicode` | | |
| `IsValidCodePage` | | |
| `IsValidLocaleName` | | |
| `LCIDToLocaleName` | | |
| `LCMapStringEx` | | |
| `LocaleNameToLCID` | | |
| `ResolveLocaleName` | | |
| `SetThreadLocale` | | |
| `CompareString` | DEPRECATED | `CompareStringEx` |
| `CompareStringA` | DEPRECATED | `CompareStringEx` |
| `EnumSystemLocalesA` | DEPRECATED | `EnumSystemLocalesEx` |
| `EnumSystemLocalesW` | DEPRECATED | `EnumSystemLocalesEx` |
| `FindNLSString` | DEPRECATED | `FindNLSStringEx` |
| `GetCPInfo` | DEPRECATED | 使用 Unicode |
| `GetCPInfoExA` | DEPRECATED | 使用 Unicode |
| `GetCPInfoExW` | DEPRECATED | 使用 Unicode |
| `GetCurrencyFormatA` | DEPRECATED | `GetCurrencyFormatEx` |
| `GetCurrencyFormatW` | DEPRECATED | `GetCurrencyFormatEx` |
| `GetGeoInfoA` | DEPRECATED | `GetGeoInfoEx` |
| `GetGeoInfoW` | DEPRECATED | `GetGeoInfoEx` |
| `GetLocaleInfoA` | DEPRECATED | `GetLocaleInfoEx` |
| `GetLocaleInfoW` | DEPRECATED | `GetLocaleInfoEx` |
| `GetNumberFormatA` | DEPRECATED | `GetNumberFormatEx` |
| `GetNumberFormatW` | DEPRECATED | `GetNumberFormatEx` |
| `GetUserGeoID` | DEPRECATED | `GetUserDefaultLocaleName` |
| `LCMapStringA` | DEPRECATED | `LCMapStringEx` |
| `LCMapStringW` | DEPRECATED | `LCMapStringEx` |

## Game OS 行為注意事項

Game OS 的 NLS 函式**不**包含 Windows 所具備的完整語言大小寫對應表。無論地區設定為何,定序與大小寫轉換作業一律使用**序數**值。

**請在當地語系化流程中處理區分文化特性的大小寫轉換與排序**,而不是在執行階段處理。

受影響的函式:

| NLS |
| - |
| `LCMapStringEx` |
| `CompareStringEx` |
| `CompareString` |
| `CompareStringA` |

### 定序

| 基本 | 寬字元 | 多位元組 |
| - | - | - |
| `std::collate` | | |
| `strcoll` | `wcscoll` | `_mbscoll` |
| `_stricoll` | `_wcsicoll` | `_mbsicoll` |
| `_strncoll` | `_wcsncoll` | `_mbsncoll` |
| `_strnicoll` | `_wcsnicoll` | `_mbsnicoll` |

### 轉換為大寫

| 基本 | 變體 | 寬字元變體 |
| - | - | - |
| `std::toupper` | `toupper` | `towupper` |
| `_toupper` | `_toupper_l` | `_towupper_l` |
| `std::isupper` | `isupper` | `iswupper` |
| `_isupper_l` | `_iswupper_l` | |

### 轉換為小寫

| 基本 | 變體 | 寬字元變體 |
| - | - | - |
| `std::tolower` | `tolower` | `towlower` |
| `_tolower` | `_tolower_l` | `_towlower_l` |
| `std::islower` | `islower` | `iswlower` |
| `_islower_l` | `_iswlower_l` | |

<Note>
  此清單並未詳列所有項目,其他標準 C++ 程式庫函式也可能相依於受影響的 API。
</Note>

## 相關 API 文件

* [XGameRuntime 功能參考](/zh-TW/reference/system/xgameruntimefeature/xgameruntimefeature_members):補充 NLS 的地區設定 + 區域 GDK 介面


## Related topics

- [當地語系化與全球化概觀](/zh-TW/build/game-principles/localization.md)
- [搭配 GDK 使用 Clang/LLVM](/zh-TW/tools/tools-pc/visualstudio/gr-vs-clang.md)
- [在主機上搭配 GDK 使用 Clang/LLVM](/zh-TW/tools/tools-console/visualstudio/vs-clang.md)
- [vmulComplex 函式](/zh-TW/reference/audio/xdsp/functions/vmulcomplex.md)
- [PIXBeginEvent 函式](/zh-TW/reference/tools/pix3/functions/pixbeginevent.md)
