From 508659d6cdf450a2e8aa053902661f068ceb158d Mon Sep 17 00:00:00 2001 From: Rageking8 Date: Sun, 7 Sep 2025 22:40:39 +0800 Subject: [PATCH 1/4] Add missing leading underscore for `_MBCS` and `_mbsrev` in "Using generic-text mappings" topic --- docs/c-runtime-library/using-generic-text-mappings.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/c-runtime-library/using-generic-text-mappings.md b/docs/c-runtime-library/using-generic-text-mappings.md index 388ffd33974..5b2ef0c7e67 100644 --- a/docs/c-runtime-library/using-generic-text-mappings.md +++ b/docs/c-runtime-library/using-generic-text-mappings.md @@ -21,7 +21,7 @@ To simplify code development for various international markets, the Microsoft ru | `_MBCS` | Multibyte-character | `_tcsrev` maps to `_mbsrev` | | None (the default: both `_UNICODE` and `_MBCS` not defined) | SBCS (ASCII) | `_tcsrev` maps to `strrev` | -For example, the generic-text function `_tcsrev`, defined in TCHAR.H, maps to `mbsrev` if `MBCS` has been defined in your program, or to `_wcsrev` if `_UNICODE` has been defined. Otherwise `_tcsrev` maps to `strrev`. +For example, the generic-text function `_tcsrev`, defined in TCHAR.H, maps to `_mbsrev` if `_MBCS` has been defined in your program, or to `_wcsrev` if `_UNICODE` has been defined. Otherwise `_tcsrev` maps to `strrev`. The generic-text data type `_TCHAR`, also defined in TCHAR.H, maps to type **`char`** if `_MBCS` is defined, to type **`wchar_t`** if `_UNICODE` is defined, and to type **`char`** if neither constant is defined. Other data type mappings are provided in TCHAR.H for programming convenience, but `_TCHAR` is the type that is most useful. @@ -45,7 +45,7 @@ _TCHAR *RetVal, *szString; RetVal = _tcsrev(szString); ``` -If `MBCS` has been defined, the preprocessor maps the preceding fragment to the following code: +If `_MBCS` has been defined, the preprocessor maps the preceding fragment to the following code: ```C char *RetVal, *szString; From fa38646ce5f8badf1904999dfe48ef0034c3df8a Mon Sep 17 00:00:00 2001 From: Rageking8 Date: Sun, 7 Sep 2025 22:43:22 +0800 Subject: [PATCH 2/4] Add backticks in "Using generic-text mappings" topic --- docs/c-runtime-library/using-generic-text-mappings.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/c-runtime-library/using-generic-text-mappings.md b/docs/c-runtime-library/using-generic-text-mappings.md index 5b2ef0c7e67..c55c47f89e8 100644 --- a/docs/c-runtime-library/using-generic-text-mappings.md +++ b/docs/c-runtime-library/using-generic-text-mappings.md @@ -11,7 +11,7 @@ ms.assetid: 2848121c-e51f-4b9b-a2e6-833ece4b0cb3 **Microsoft Specific** -To simplify code development for various international markets, the Microsoft run-time library provides Microsoft-specific "generic-text" mappings for many data types, routines, and other objects. These mappings are defined in TCHAR.H. You can use these name mappings to write generic code that can be compiled for any of the three kinds of character sets: ASCII (SBCS), MBCS, or Unicode, depending on a manifest constant you define using a `#define` statement. Generic-text mappings are Microsoft extensions that aren't ANSI compatible. +To simplify code development for various international markets, the Microsoft run-time library provides Microsoft-specific "generic-text" mappings for many data types, routines, and other objects. These mappings are defined in `TCHAR.H`. You can use these name mappings to write generic code that can be compiled for any of the three kinds of character sets: ASCII (SBCS), MBCS, or Unicode, depending on a manifest constant you define using a `#define` statement. Generic-text mappings are Microsoft extensions that aren't ANSI compatible. ### Preprocessor directives for generic-text mappings @@ -21,13 +21,13 @@ To simplify code development for various international markets, the Microsoft ru | `_MBCS` | Multibyte-character | `_tcsrev` maps to `_mbsrev` | | None (the default: both `_UNICODE` and `_MBCS` not defined) | SBCS (ASCII) | `_tcsrev` maps to `strrev` | -For example, the generic-text function `_tcsrev`, defined in TCHAR.H, maps to `_mbsrev` if `_MBCS` has been defined in your program, or to `_wcsrev` if `_UNICODE` has been defined. Otherwise `_tcsrev` maps to `strrev`. +For example, the generic-text function `_tcsrev`, defined in `TCHAR.H`, maps to `_mbsrev` if `_MBCS` has been defined in your program, or to `_wcsrev` if `_UNICODE` has been defined. Otherwise `_tcsrev` maps to `strrev`. -The generic-text data type `_TCHAR`, also defined in TCHAR.H, maps to type **`char`** if `_MBCS` is defined, to type **`wchar_t`** if `_UNICODE` is defined, and to type **`char`** if neither constant is defined. Other data type mappings are provided in TCHAR.H for programming convenience, but `_TCHAR` is the type that is most useful. +The generic-text data type `_TCHAR`, also defined in `TCHAR.H`, maps to type **`char`** if `_MBCS` is defined, to type **`wchar_t`** if `_UNICODE` is defined, and to type **`char`** if neither constant is defined. Other data type mappings are provided in `TCHAR.H` for programming convenience, but `_TCHAR` is the type that is most useful. ### Generic-Text Data Type Mappings -| Generic-text data type name | SBCS (_UNICODE, _MBCS not defined) | _MBCS defined | _UNICODE defined | +| Generic-text data type name | SBCS (`_UNICODE`, `_MBCS` not defined) | `_MBCS` defined | `_UNICODE` defined | |---|---|---|---| | `_TCHAR` | **`char`** | **`char`** | **`wchar_t`** | | `_TINT` | **`int`** | **`int`** | `wint_t` | From e05522ca4a62cd5973699514f3a51d2fea2e5555 Mon Sep 17 00:00:00 2001 From: Rageking8 Date: Sun, 7 Sep 2025 22:44:41 +0800 Subject: [PATCH 3/4] Clean up unneeded `./` link prefix in "Using generic-text mappings" topic --- .../c-runtime-library/using-generic-text-mappings.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/c-runtime-library/using-generic-text-mappings.md b/docs/c-runtime-library/using-generic-text-mappings.md index c55c47f89e8..d2d9e78c71b 100644 --- a/docs/c-runtime-library/using-generic-text-mappings.md +++ b/docs/c-runtime-library/using-generic-text-mappings.md @@ -36,7 +36,7 @@ The generic-text data type `_TCHAR`, also defined in `TCHAR.H`, maps to type **` | `_TXCHAR` | **`char`** | **`unsigned char`** | **`wchar_t`** | | `_T` or `_TEXT` | No effect (removed by preprocessor) | No effect (removed by preprocessor) | `L` (converts following character or string to its Unicode counterpart) | -For a complete list of generic-text mappings of routines, variables, and other objects, see [Generic-text mappings](./generic-text-mappings.md). +For a complete list of generic-text mappings of routines, variables, and other objects, see [Generic-text mappings](generic-text-mappings.md). The following code fragments illustrate the use of `_TCHAR` and `_tcsrev` for mapping to the MBCS, Unicode, and SBCS models. @@ -72,8 +72,8 @@ These macros let you write, maintain, and compile a single source code file usin ## See also -[Generic-text mappings](./generic-text-mappings.md)\ -[Data type mappings](./data-type-mappings.md)\ -[Constant and global variable mappings](./constant-and-global-variable-mappings.md)\ -[Routine mappings](./routine-mappings.md)\ -[A sample generic-text program](./a-sample-generic-text-program.md) +[Generic-text mappings](generic-text-mappings.md)\ +[Data type mappings](data-type-mappings.md)\ +[Constant and global variable mappings](constant-and-global-variable-mappings.md)\ +[Routine mappings](routine-mappings.md)\ +[A sample generic-text program](a-sample-generic-text-program.md) From 2270f667375f337301093040e2c8c2d9aa66eade Mon Sep 17 00:00:00 2001 From: Rageking8 Date: Sun, 7 Sep 2025 22:45:44 +0800 Subject: [PATCH 4/4] Update metadata in "Using generic-text mappings" topic --- docs/c-runtime-library/using-generic-text-mappings.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/c-runtime-library/using-generic-text-mappings.md b/docs/c-runtime-library/using-generic-text-mappings.md index d2d9e78c71b..c40da0e91c3 100644 --- a/docs/c-runtime-library/using-generic-text-mappings.md +++ b/docs/c-runtime-library/using-generic-text-mappings.md @@ -1,11 +1,10 @@ --- title: "Using Generic-Text Mappings" description: "An introduction to Microsoft-specific mappings for data types, routines, and other objects in the C runtime." +ms.date: 11/04/2016 ms.topic: "concept-article" -ms.date: "11/04/2016" f1_keywords: ["_UNICODE"] helpviewer_keywords: ["_TXCHAR type", "TINT type", "_TCHAR type", "TSCHAR type", "TEXT type", "TCHAR type", "TCHAR.H data types, mappings defined in", "generic-text data types", "_TINT type", "TUCHAR type", "_UNICODE constant", "TXCHAR type", "generic-text mappings", "_TSCHAR type", "T type", "mappings, generic-text", "_TUCHAR type", "MBCS data type", "_MBCS data type", "_TEXT type", "UNICODE constant", "_T type"] -ms.assetid: 2848121c-e51f-4b9b-a2e6-833ece4b0cb3 --- # Using generic-text mappings