Share via


_ismbcgraph, _ismbcgraph_l, _ismbcprint, _ismbcprint_l, _ismbcpunct, _ismbcpunct_l, _ismbcblank, _ismbcblank_l, _ismbcspace, _ismbcspace_l

判斷字元是否為圖形字元、顯示字元、標點符號字元或空白字元。

重要

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

語法

int _ismbcgraph(
   unsigned int c
);
int _ismbcgraph_l(
   unsigned int c,
   _locale_t locale
);
int _ismbcprint(
   unsigned int c
);
int _ismbcprint_l(
   unsigned int c,
   _locale_t locale
);
int _ismbcpunct(
   unsigned int c
);
int _ismbcpunct_l(
   unsigned int c,
   _locale_t locale
);
int _ismbcblank(
   unsigned int c
);
int _ismbcblank_l(
   unsigned int c,
   _locale_t locale
);
int _ismbcspace(
   unsigned int c
);
int _ismbcspace_l(
   unsigned int c,
   _locale_t locale
);

參數

c
需要判斷的字元。

locale
要使用的地區設定。

傳回值

如果字元符合測試條件,則每個常式都會傳回非零值。 否則會傳回 0。 如果 c< = 255 且有對應的 _ismbb 常式(例如 _ismbcalnum ,對應至 _ismbbalnum ),則結果會是對應 _ismbb 常式的傳回值。

這些函式版本都完全相同,除了具有 _l 尾碼的函式會使用傳入的地區設定參數來處理地區設定相關行為,而不使用目前的地區設定。 如需詳細資訊,請參閱 Locale

備註

這些函式每一個都會測試指定的多位元組字元是否符合指定的條件。

常式 測試條件 字碼頁 932 範例
_ismbcgraph Graphic 只有在 是任何 ASCII 或片假名可列印字元的單一位元組表示時,才會 c 傳回非零值,但空白字元除外。
_ismbcprint 可列印 只有在 是任何 ASCII 或片假名可列印字元的單一位元組標記法時,才會 c 傳回非零,包括空白字元。
_ismbcpunct 標點符號 只有在 c 是代表任何 ASCII 或片假名標點符號字元的單一位元組時,才傳回非零。
_ismbcblank 空格或水平索引標籤 只有在 c 是空格或水平索引標籤字元時,才傳回非零︰c=0x20 或 c=0x09。
_ismbcspace 空白字元 只有在 是空白字元時,才會 c 傳回非零值: c =0x20 或 0x09 < = c< =0x0D。

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

需求

常式 必要的標頭
_ismbcgraph <mbstring.h>
_ismbcgraph_l <mbstring.h>
_ismbcprint <mbstring.h>
_ismbcprint_l <mbstring.h>
_ismbcpunct <mbstring.h>
_ismbcpunct_l <mbstring.h>
_ismbcblank <mbstring.h>
_ismbcblank_l <mbstring.h>
_ismbcspace <mbstring.h>
_ismbcspace_l <mbstring.h>

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

程式庫

所有版本的 C 執行階段程式庫

另請參閱

字元分類
地區設定
多位元組字元序列的解譯
_ismbc 例 程
isisw 常式
_ismbb 例 程