treeScannerC/doc/setconsoleoutputcp.md

33 lines
580 B
Markdown
Raw Permalink Normal View History

2025-05-09 22:46:31 +02:00
# SetConsoleOutputCP Funktion (Windows API)
Mit `SetConsoleOutputCP()` kann die Ausgabe-Codepage der Konsole geändert werden z.B. für UTF-8.
## Definition
```c
BOOL SetConsoleOutputCP(UINT wCodePageID);
```
## Parameter
- `wCodePageID`: Ziel-Codepage, z.B. `65001` für UTF-8
## Beispiel
```c
#include <windows.h>
int main() {
SetConsoleOutputCP(65001); // Aktiviert UTF-8-Ausgabe
printf("📁 Datei
");
return 0;
}
```
## Hinweise
- Nur unter Windows verfügbar
- Gilt nur für das aktive Konsolenfenster
- Muss vor Unicode-Ausgabe erfolgen