Share via


_mbctolower, _mbctolower_l, _mbctoupper, _mbctoupper_l

測試並轉換多位元組字元的大小寫。

重要

這個 API 不能用於在 Windows 執行階段中執行的應用程式。 如需詳細資訊,請參閱 CRT functions not supported in Universal Windows Platform apps (通用 Windows 平台應用程式中不支援的 CRT 函式)。

語法

unsigned int _mbctolower(
   unsigned int c
);
unsigned int _mbctolower_l(
   unsigned int c,
   _locale_t locale
);
unsigned int _mbctoupper(
   unsigned int c
);
unsigned int _mbctoupper_l(
   unsigned int c,
   _locale_t locale
);

參數

c
要轉換的多位元組字元。

locale
要使用的地區設定。

傳回值

如果可能,所有這些函式都會傳回已轉換的字元 c。 否則會傳回未變更的字元 c

備註

這些函式會測試字元 c,如果可能的話,還會套用下列其中一個轉換。

常式 轉換
_mbctolower, _mbctolower_l 將大寫字元轉換為小寫字元。
_mbctoupper, _mbctoupper_l 將小寫字元轉換為大寫字元。

輸出值會受到 LC_CTYPE 地區設定之類別設定的影響。 如需詳細資訊,請參閱setlocale。 這個沒有 _l 後置字元的函式版本,會針對此與地區設定相關的行為使用目前的地區設定;具有 _l 後置字元的版本與其相同,只不過它會改用傳入的地區設定參數。 如需詳細資訊,請參閱 Locale

在舊版中, _mbctolower 稱為 jtolower ,並 _mbctoupper 稱為 jtoupper 。 對於新的程式碼,請改用新名稱。

根據預設,此函式的全域狀態會限定于應用程式。 若要變更此行為,請參閱 CRT 中的全域狀態。

泛型文字常式對應

Tchar.h 常式 _UNICODE_MBCS 未定義 _MBCS 定義 _UNICODE 定義
_totlower tolower _mbctolower towlower
_totlower_l _tolower_l _mbctolower_l _towlower_t
_totupper toupper _mbctoupper towupper
_totupper_l toupper_l _mbctoupper_l _towupper_l

需求

常式 必要的標頭
_mbctolower, _mbctolower_l <mbstring.h>
_mbctoupper, _mbctoupper_l <mbstring.h>

如需相容性詳細資訊,請參閱相容性

另請參閱

資料轉換
_mbbtombc, _mbbtombc_l
_mbcjistojms, _mbcjistojms_l, _mbcjmstojis, _mbcjmstojis_l
_mbctohira, _mbctohira_l, _mbctokata, _mbctokata_l
_mbctombb, _mbctombb_l