Skip to content

Commit b21c5d4

Browse files
TylerMSFTTylerMSFT
authored andcommitted
add clarifying note for cs flag per github 4234
1 parent f093acf commit b21c5d4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

docs/c-runtime-library/reference/fopen-wfopen.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["STDIO/fopen", "CORECRT_WSTDIO/_wfopen", "TCHAR/_tfopen", "fopen", "_wfopen", "_tfopen"]
1010
helpviewer_keywords: ["opening files, for file I/O", "wfopen function", "tfopen function", "_tfopen function", "_wfopen function", "files [C++], opening", "fopen function"]
11-
ms.assetid: e868993f-738c-4920-b5e4-d8f2f41f933d
1211
---
1312
# `fopen`, `_wfopen`
1413

@@ -70,7 +69,7 @@ The following table summarizes the modes that are used for various **`ccs`** fla
7069

7170
### Encodings used based on ccs flag and BOM
7271

73-
| ccs flag | No BOM (or new file) | BOM: UTF-8 | BOM: UTF-16 |
72+
| `ccs` flag | No BOM (or new file) | BOM: UTF-8 | BOM: UTF-16 |
7473
|--|--|--|--|
7574
| `UNICODE` | **`UTF-16LE`** | **`UTF-8`** | **`UTF-16LE`** |
7675
| **`UTF-8`** | **`UTF-8`** | **`UTF-8`** | **`UTF-16LE`** |
@@ -82,7 +81,7 @@ If *`mode`* is **`a, ccs=encoding`** for some `encoding` value, **`fopen`** firs
8281

8382
### Generic-text routine mappings
8483

85-
| TCHAR.H routine | `_UNICODE` and `_MBCS` not defined | `_MBCS` defined | `_UNICODE` defined |
84+
| `TCHAR.H` routine | `_UNICODE` and `_MBCS` not defined | `_MBCS` defined | `_UNICODE` defined |
8685
|--|--|--|--|
8786
| **`_tfopen`** | **`fopen`** | **`fopen`** | **`_wfopen`** |
8887

@@ -130,7 +129,7 @@ The following options can be appended to *`mode`* to specify more behaviors.
130129
| **`R`** | Specifies that caching is optimized for, but not restricted to, random access from disk. |
131130
| **`T`** | Specifies a file as temporary. If possible, it isn't flushed to disk. |
132131
| **`D`** | Specifies a file as temporary. It's deleted when the last file pointer is closed. |
133-
| **`ccs=encoding`** | Specifies the encoded character set to use (one of **`UTF-8`**, **`UTF-16LE`**, or `UNICODE`) for this file. Leave unspecified if you want ANSI encoding. |
132+
| **`ccs=encoding`** | Specifies the encoded character set to use (one of **`UTF-8`**, **`UTF-16LE`**, or `UNICODE`) for this file. Leave unspecified if you want ANSI encoding. This flag is separated from flags that precede it by a comma (`,`). For example: `FILE *f = fopen("newfile.txt", "rt+, ccs=UTF-8");` |
134133

135134
Valid characters for the *`mode`* string that is used in **`fopen`** and **`_fdopen`** correspond to *`oflag`* arguments that are used in [`_open`](open-wopen.md) and [`_sopen`](sopen-wsopen.md), as follows.
136135

0 commit comments

Comments
 (0)