Ticket #41679

-finput-charset=cp437 completely glitches the result

Date d'ouverture: 2021-03-02 16:44 Dernière mise à jour: 2021-03-02 16:44

Rapporteur:
Propriétaire:
(Aucun)
Type:
État:
Ouvert
Composant:
Jalon:
(Aucun)
Priorité:
5 - moyen
Sévérité:
5 - moyen
Résolution:
Aucun
Fichier:
Aucun
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Détails

Here is the code I have, in a CP437 file.

  1. #include <iostream>
  2. int main(){
  3. std::cout << "\
  4. ÇüéâäàåçêëèïîìÄÅ\n\
  5. ÉæÆôöòûùÿÖÜ¢£¥₧ƒ\n\
  6. áíóúñѪº¿⌐¬½¼¡«»\n\
  7. ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐\n\
  8. └┴┬├─┼╞╟╚╔╩╦╠═╬╧\n\
  9. ╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀\n\
  10. αßΓπΣσµτΦΘΩδ∞φε∩\n\
  11. ≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \
  12. ";
  13. }

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 History (1/1 Histories)

2021-03-02 16:44 Updated by: piotrgrochowski
  • New Ticket "-finput-charset=cp437 completely glitches the result" created

Attachment File List

No attachments

Modifier

Please login to add comment to this ticket » Connexion