简体   繁体   中英

How can I print extended ASCII characters in C?

How can I print for example "¶"?

I need to print some ASCII extended characters but obviously printf("¶"); dosen't work. Some other posts have taken me to this webpage but I don't know yet if there is any way to do it.

I would appreciate some help. Thanks in advance.

If you are using windows, try typing chcp 65001 in cmd before you execute the program.
This will set terminal's codepage to Unicode, allowing programs to print unicode chars.
For example, if your.exe file is in C:\Users\You\Desktop\test.exe :

> cd C:\Users\You\Desktop
> chcp 65001
> test.exe

This will also allow you to print other Unicode chars such as ⑩.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM