Skip to content

Commit fafa338

Browse files
authored
Merge pull request #5749 from Rageking8/fix-and-clean-up-using-generic-text-mappings-topic
Fix and clean up "Using generic-text mappings" topic
2 parents 2a04d84 + 2270f66 commit fafa338

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

docs/c-runtime-library/using-generic-text-mappings.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
---
22
title: "Using Generic-Text Mappings"
33
description: "An introduction to Microsoft-specific mappings for data types, routines, and other objects in the C runtime."
4+
ms.date: 11/04/2016
45
ms.topic: "concept-article"
5-
ms.date: "11/04/2016"
66
f1_keywords: ["_UNICODE"]
77
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"]
8-
ms.assetid: 2848121c-e51f-4b9b-a2e6-833ece4b0cb3
98
---
109
# Using generic-text mappings
1110

1211
**Microsoft Specific**
1312

14-
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.
13+
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.
1514

1615
### Preprocessor directives for generic-text mappings
1716

@@ -21,13 +20,13 @@ To simplify code development for various international markets, the Microsoft ru
2120
| `_MBCS` | Multibyte-character | `_tcsrev` maps to `_mbsrev` |
2221
| None (the default: both `_UNICODE` and `_MBCS` not defined) | SBCS (ASCII) | `_tcsrev` maps to `strrev` |
2322

24-
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`.
23+
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`.
2524

26-
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.
25+
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.
2726

2827
### Generic-Text Data Type Mappings
2928

30-
| Generic-text data type name | SBCS (_UNICODE, _MBCS not defined) | _MBCS defined | _UNICODE defined |
29+
| Generic-text data type name | SBCS (`_UNICODE`, `_MBCS` not defined) | `_MBCS` defined | `_UNICODE` defined |
3130
|---|---|---|---|
3231
| `_TCHAR` | **`char`** | **`char`** | **`wchar_t`** |
3332
| `_TINT` | **`int`** | **`int`** | `wint_t` |
@@ -36,7 +35,7 @@ The generic-text data type `_TCHAR`, also defined in TCHAR.H, maps to type **`ch
3635
| `_TXCHAR` | **`char`** | **`unsigned char`** | **`wchar_t`** |
3736
| `_T` or `_TEXT` | No effect (removed by preprocessor) | No effect (removed by preprocessor) | `L` (converts following character or string to its Unicode counterpart) |
3837

39-
For a complete list of generic-text mappings of routines, variables, and other objects, see [Generic-text mappings](./generic-text-mappings.md).
38+
For a complete list of generic-text mappings of routines, variables, and other objects, see [Generic-text mappings](generic-text-mappings.md).
4039

4140
The following code fragments illustrate the use of `_TCHAR` and `_tcsrev` for mapping to the MBCS, Unicode, and SBCS models.
4241

@@ -45,7 +44,7 @@ _TCHAR *RetVal, *szString;
4544
RetVal = _tcsrev(szString);
4645
```
4746

48-
If `MBCS` has been defined, the preprocessor maps the preceding fragment to the following code:
47+
If `_MBCS` has been defined, the preprocessor maps the preceding fragment to the following code:
4948

5049
```C
5150
char *RetVal, *szString;
@@ -72,8 +71,8 @@ These macros let you write, maintain, and compile a single source code file usin
7271

7372
## See also
7473

75-
[Generic-text mappings](./generic-text-mappings.md)\
76-
[Data type mappings](./data-type-mappings.md)\
77-
[Constant and global variable mappings](./constant-and-global-variable-mappings.md)\
78-
[Routine mappings](./routine-mappings.md)\
79-
[A sample generic-text program](./a-sample-generic-text-program.md)
74+
[Generic-text mappings](generic-text-mappings.md)\
75+
[Data type mappings](data-type-mappings.md)\
76+
[Constant and global variable mappings](constant-and-global-variable-mappings.md)\
77+
[Routine mappings](routine-mappings.md)\
78+
[A sample generic-text program](a-sample-generic-text-program.md)

0 commit comments

Comments
 (0)