#41679: -finput-charset=cp437 completely glitches the result Open Date: 2021-03-02 16:44 Last Update: 2021-03-02 16:44 URL for this Ticket: https://osdn.net//projects/mingw/ticket/41679 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=41679 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2021-03-02 16:44 Updated by: piotrgrochowski * New Ticket "-finput-charset=cp437 completely glitches the result" created --------------------------------------------------------------------- Ticket Status: Reporter: piotrgrochowski Owner: (None) Type: Issues Status: Open Priority: 5 - Medium MileStone: (None) Component: GCC Severity: 5 - Medium Resolution: None --------------------------------------------------------------------- Ticket details: Here is the code I have, in a CP437 file. #include <iostream> int main(){ std::cout << "\ ÇüéâäàåçêëèïîìÄÅ\n\ ÉæÆôöòûùÿÖÜ¢£¥₧ƒ\n\ áíóúñѪº¿⌐¬½¼¡«»\n\ ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐\n\ └┴┬├─┼╞╟╚╔╩╦╠═╬╧\n\ ╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀\n\ αßΓπΣσµτΦΘΩδ∞φε∩\n\ ≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \ "; }When I use default settings, it properly makes it print the characters in the native codepage: ÇüéâäůćçłëŐőîŹÄĆ ÉĹĺôöĽľŚśÖÜŤťŁ×č áíóúĄąŽžĘ꬟Ⱥ«» ░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐ └┴┬├─┼Ăă╚╔╩╦╠═╬¤ đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ ÓßÔŃńňŠšŔÚŕŰýÝţ´ ˝˛ˇ˘§÷¸°¨˙űŘř■ However, when I use -finput-charset=cp437 , it completely garbles the output. ├ç├╝├ę├ó├Ą├á├ą├ž├¬├ź├Ę├»├«├Č├ä├ů ├ë├Ž├ć├┤├Â├▓├╗├╣├┐├ľ├ť┬ó┬ú┬ąÔéžĂĺ ├í├ş├│├║├▒├Ĺ┬¬┬║┬┐ÔîÉ┬Č┬Ż┬╝┬í┬ź┬╗ ÔľĹÔľĺÔľôÔöéÔöĄÔĽíÔĽóÔĽľÔĽĽÔĽúÔĽĹÔĽŚÔĽŁÔĽťÔĽŤÔöÉ ÔööÔö┤ÔöČÔöťÔöÇÔö╝ÔĽ×ÔĽčÔĽÜÔĽöÔĽęÔĽŽÔĽáÔĽÉÔĽČÔĽž ÔĽĘÔĽĄÔĽąÔĽÖÔĽśÔĽĺÔĽôÔĽźÔĽ¬ÔöśÔöîÔľłÔľäÔľîÔľÉÔľÇ ╬▒├č╬ô¤Ç╬ú¤â┬Á¤ä╬Ž╬ś╬ę╬┤Գפć╬ÁÔłę Ôëí┬▒ÔëąÔëĄÔîáÔîí├ĚÔëł┬░ÔłÖ┬ĚÔłÜÔü┐┬▓Ôľá┬á Instead, the result should be the same as the default compiler result. I have nothing to do with UTF-8, it needs to get out of my way and does not belong in char type, I requested the compiler to do cp437 and it glitched. Because CP437 is already a fixed width char type, strings should pass the higher bytes directly to the byte stream, not garble them. -- Ticket information of MinGW - Minimalist GNU for Windows project MinGW - Minimalist GNU for Windows Project is hosted on OSDN Project URL: https://osdn.net/projects/mingw/ OSDN: https://osdn.net URL for this Ticket: https://osdn.net/projects/mingw/ticket/41679 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=41679