待辦事項 #41679

-finput-charset=cp437 completely glitches the result

啟用日期: 2021-03-02 16:44 最後更新: 2021-03-02 16:44

回報者:
負責人:
(無)
類型:
狀態:
開啟
元件:
里程碑:
(無)
優先權:
5 - 中
嚴重程度:
5 - 中
處理結果:
檔案:
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

細節

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

編輯

Please login to add comment to this ticket » 登入