如何使用扩展ASCII表中的符号用C? [英] How to use symbols of extended ASCII table in C?

查看:515
本文介绍了如何使用扩展ASCII表中的符号用C?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图打印扩展ASCII字符

I've been tried to print Extended ASCII characters:

HTTP://www.theascii$c$c.com.ar/ <​​/A>

http://www.theasciicode.com.ar/

但是,所有这些符号被打印成的问题的字符数限制在白色背景上的

But all those symbols were printed as question-character on the white background ?.

我用下面的循环来打印符号:

I use the following cycle to print that symbols:

for (i = 0; i <= 30; i++)
    printf("%c", 201); 

问:有什么方法来打印这些扩展ASCII字符或不?或者,也许有这些特殊字符库?

Question: Is there any way to print those Extended ASCII characters or not? Or maybe there is special library for these characters?

操作系统Linux操作系统Ubuntu 13.04,code :: Blocks的12.11 IDE。

OS Linux Ubuntu 13.04, Code::Blocks 12.11 IDE.

推荐答案

这是更好地使用UNI code比ASCII扩展,这是不规范的。关于C印花单code字符的螺纹:
<一href=\"http://stackoverflow.com/questions/15528359/printing-utf-8-strings-with-printf-wide-vs-multibyte-string-literals\">printing-utf-8-strings-with-printf-wide-vs-multibyte-string-literals

It's better to use unicode than extended ASCII, which is non-standard. A thread about printing unicode characters in C : printing-utf-8-strings-with-printf-wide-vs-multibyte-string-literals

不过说实在的,你需要复制粘贴单向code字..

But indeed you need to copy paste unicode characters..

有一个更好的方式开始:

A better way to start:

#include <stdio.h>

int main() {
    printf("\u2500\u2501\n");
}

请参阅https://en.wikipedia.org/wiki/Box-drawing_character#Uni$c$c为这个扩展ASCII风格箱艺术UNI code字..

See https://en.wikipedia.org/wiki/Box-drawing_character#Unicode for unicode characters for this extended ASCII style box art..

这篇关于如何使用扩展ASCII表中的符号用C?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆