C1 control characters break SetConsoleTitleW API #14083

Open
opened 2026-01-31 04:00:27 +00:00 by claunia · 0 comments
Owner

Originally created by @alabuzhev on GitHub (Jun 2, 2021).

Windows Terminal version (or Windows build number)

1.9.1445.0

Other Software

No response

Steps to reproduce

  • Compile and run the following code:
#include <windows.h>

int main()
{
	if (!SetConsoleTitleW(L"\x80 Spanish Inquisition"))
		return 1;

	MessageBox(0, "I didn't expect that", 0, 0);
}
  • Look at the screen and listen.

Expected Behavior

The title is set.

Actual Behavior

  • Terminal beeps and prints the string on the screen. MSDN doesn't mention any such visual or sound effects.
  • The console title is not set, yet the function returns TRUE.

This is true for other C1 characters as well, not only 0x80.

P.S. The example is not synthetic: these characters can appear in directory and file names and applications can display the current path, the name of the opened file etc. in the console title.

Originally created by @alabuzhev on GitHub (Jun 2, 2021). ### Windows Terminal version (or Windows build number) 1.9.1445.0 ### Other Software _No response_ ### Steps to reproduce - Compile and run the following code: ```C++ #include <windows.h> int main() { if (!SetConsoleTitleW(L"\x80 Spanish Inquisition")) return 1; MessageBox(0, "I didn't expect that", 0, 0); } ``` - Look at the screen and listen. ### Expected Behavior The title is set. ### Actual Behavior - Terminal *beeps* and prints the string *on the screen*. [MSDN](https://docs.microsoft.com/en-us/windows/console/setconsoletitle) doesn't mention any such visual or sound effects. - The console title is not set, yet the function returns TRUE. This is true for other C1 characters as well, not only 0x80. P.S. The example is not synthetic: these characters can appear in directory and file names and applications can display the current path, the name of the opened file etc. in the console title.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14083