| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 614 人关注过本帖
标题:[求助]输出中文的问题
只看楼主 加入收藏
criras
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2005-2-17
收藏
 问题点数:0 回复次数:2 
[求助]输出中文的问题
我用的是WIN-TC,但显示输出结果时本来应该显示中文的部分确是乱码.......
请问这是怎么回事,该如何解决?望各位指点.......
搜索更多相关主题的帖子: 中文 输出 
2005-02-20 17:37
myy_yoyo
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2005-2-24
收藏
得分:0 
不支持中文显示呗!

2005-02-24 15:15
神vLinux飘飘
Rank: 13Rank: 13Rank: 13Rank: 13
来 自:浙江杭州
等 级:贵宾
威 望:91
帖 子:6140
专家分:217
注 册:2004-7-17
收藏
得分:0 

要想在西文DOS下显示中文,这个技术属于C语言高级程序设计部分。而且必须要在图形模式下才能显示。意思就是说,把汉字当图形画出来。 下面是一个简单的例子 #include <stdio.h> #include <graphics.h>

char shen[]={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0xF0,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00, 0x00,0x00,0x78,0x00,0x00,0x78,0x00,0x00, 0x00,0x00,0x3E,0x00,0x00,0x70,0x00,0x00, 0x00,0x00,0x1F,0x00,0x00,0x70,0x00,0x00, 0x00,0x00,0x0F,0x80,0x00,0x70,0x00,0x00, 0x00,0x00,0x03,0x80,0x00,0x70,0x00,0x00, 0x00,0x00,0x01,0x00,0x00,0x70,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x70,0x0F,0x00, 0x00,0x00,0x00,0x00,0x00,0x73,0xFF,0xC0, 0x00,0x00,0x06,0x00,0x01,0xFF,0x87,0xE0, 0x00,0x00,0x1F,0x87,0xFF,0xF0,0x03,0xE0, 0x00,0x00,0x7F,0xC3,0x80,0x70,0x03,0xC0, 0x00,0x07,0xFF,0x83,0x80,0x30,0x03,0xC0, 0x00,0x7F,0x1E,0x03,0x80,0x30,0x03,0xC0, 0x0F,0xF8,0x1E,0x03,0x80,0x30,0x03,0x80, 0x03,0xC0,0x1C,0x01,0x80,0x30,0x03,0x80, 0x00,0x00,0x38,0x01,0x80,0x31,0x83,0x80, 0x00,0x00,0x38,0x01,0x80,0x3F,0x83,0x00, 0x00,0x00,0x70,0x01,0x83,0xFE,0x07,0x00, 0x00,0x00,0x60,0x01,0x80,0x30,0x07,0x00, 0x00,0x00,0xE0,0x01,0x80,0x30,0x07,0x00, 0x00,0x01,0xF0,0x00,0xC0,0x30,0x06,0x00, 0x00,0x01,0xB3,0x80,0xC0,0x30,0x06,0x00, 0x00,0x03,0xB1,0xC0,0xC0,0x30,0x06,0x00, 0x00,0x07,0x30,0xC0,0xC0,0x30,0x0E,0x00, 0x00,0x0E,0x30,0x40,0xC0,0x30,0x0C,0x00, 0x00,0x0C,0x30,0x00,0xC0,0x3F,0xFC,0x00, 0x00,0x18,0x30,0x00,0xCF,0xFF,0x0C,0x00, 0x00,0x30,0x30,0x00,0x7E,0x70,0x00,0x00, 0x00,0x60,0x30,0x00,0x40,0x70,0x00,0x00, 0x00,0xC0,0x30,0x00,0x00,0x70,0x00,0x00, 0x01,0x80,0x30,0x00,0x00,0x70,0x00,0x00, 0x03,0x00,0x30,0x00,0x00,0x70,0x00,0x00, 0x04,0x00,0x30,0x00,0x00,0x70,0x00,0x00, 0x08,0x00,0x30,0x00,0x00,0x70,0x00,0x00, 0x00,0x00,0x30,0x00,0x00,0x70,0x00,0x00, 0x00,0x00,0x30,0x00,0x00,0x70,0x00,0x00, 0x00,0x00,0x30,0x00,0x00,0x70,0x00,0x00, 0x00,0x00,0x30,0x00,0x00,0x70,0x00,0x00, 0x00,0x00,0x30,0x00,0x00,0x70,0x00,0x00, 0x00,0x00,0x30,0x00,0x00,0x30,0x00,0x00, 0x00,0x00,0x70,0x00,0x00,0x30,0x00,0x00, 0x00,0x00,0x70,0x00,0x00,0x30,0x00,0x00, 0x00,0x00,0x70,0x00,0x00,0x30,0x00,0x00, 0x00,0x00,0x30,0x00,0x00,0x30,0x00,0x00, 0x00,0x00,0x30,0x00,0x00,0x30,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };

void showhz(char *mat,int matsize,int x,int y,int color){ int i,j,k,n; n=(matsize-1)/8+1; for(j=0;j<matsize;j++) for(i=0;i<n;i++) for(k=0;k<8;k++) if(mat[j*n+i]&(0x80>>k)) putpixel(x+i*8+k,y+j,color); }

void main(){ int gd=DETECT,gm; int color=0; initgraph(&gd,&gm,""); setfillstyle(1,YELLOW); bar(0,0,640,480); showhz(shen,64,300,200,BLUE); showhz(shen,64,301,201,BLUE); getch(); closegraph(); }


淘宝杜琨
2005-02-24 15:31
快速回复:[求助]输出中文的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.030635 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved