iso-8859-1

how to output degree symbol in C programs with iso_8859-1?

你离开我真会死。 提交于 2019-12-05 21:55:30
I looked up the manual of iso_8859-1 and found the degree symbol: Oct Dec Hex Char Description 260 176 B0 ° DEGREE SIGN Code: int main( int argc, char *argv[]) { char chr = 176; //stores the extended ASCII of a symbol printf("Character with an ascii code of 251: %c \n", chr); return 0; } But it printed out as ? . How could I output a degree symbol in a C programme? Do I need to include some files? To use other characters than ASCII, on most platforms you have to switch to a "locale" that is able to handle such characters. At the beginning of your main you should have #include <locale.h> int

Which code set is /etc/passwd stored in? Can it be UTF-8? What limits are placed on user names?

孤街醉人 提交于 2019-12-05 21:49:52
问题 On a modern Unix or Linux system, how can you tell which code set the /etc/passwd file stores user names in? Are user names allowed to contain accented characters (from the range 0x80..0xFF in, say, ISO 8859-1 or 8859-15)? Can the /etc/passwd file contain UTF-8? Can you tell that it contains UTF-8? What about the plain text of passwords before they are encrypted or hashed? Clearly, if the usernames and other data is limited to the 0x00..0x7F range (and excludes 0x00 anyway), then there is no

Javascript -> Download CSV file encoded in ISO-8859-1 / Latin1 / Windows-1252

浪尽此生 提交于 2019-12-05 17:18:56
I have hacked together a small tool to extract shipping data from Amazon CSV order data. it works so far. here is a simple version as JS Bin: http://output.jsbin.com/jarako For printing stamps/shipping labels, I need a file for uploading to Deutsche Post and to other parcel services. I used a small function saveTextAsFile which i found on stackoverflow. Everything good so far. No wrong displayed special characters (äöüß...) in the output textarea or downloaded files. All these german post / parcel services sites accept only latin1 / iso-8859-1 encoded files for upload. But my downloaded file

Reading iso-8859-1 rss feed C# WP7

谁都会走 提交于 2019-12-05 17:16:30
I'm trying to read a rss feed which uses the iso-8859-1 encoding. I can get all elements fine, the problem is when I put it in a textblock it will not show all characters. I'm not sure what i'm doing wrong. i've tried a few solutions I found on google but this didn't work for me. I must be missing something.. It's also the first time I really work with anything other than utf-16. I never had to convert anything before. The app works as follows I downloadstring async(WebClient). So when that is called I get a string containing the complete rss feed. I have tried getting the bytes, then encoding

Character Set Special Characters

独自空忆成欢 提交于 2019-12-05 00:03:02
问题 Is iso-8859-1 a proper subset of utf-8? What about iso-8859-n? What about windows-1252? If the answer is no to any of the above, what are the disjoint characters? I'm testing some logic that detects charsets and want to write tests to verify the detection is working properly. 回答1: Is iso-8859-1 a proper subset of utf-8? The character reportoire of ISO-8859-1 (the first 256 characters of Unicode) is a proper subset of that of UTF-8 (every Unicode character). However, the characters U+0080 to U

字符集编码详解(学习,看一篇就够了)

我的未来我决定 提交于 2019-12-04 21:14:54
置顶 2018-11-11 17:25:14 笑我归无处 阅读数 6456 更多 分类专栏: 基础 版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。 本文链接: https://blog.csdn.net/qq_42068856/article/details/83792174 最近学习字符集编码,发现很多博文的讲解对初学者很不友善,许多文章繁杂且不易懂,需要阅读了大量文章和查询资料后,才能明白字符集及相关概念,本文致力于一篇文章就可以让初学者对字符集有一个很好的认识,为将来开发项目充实其理论基础,为解决BUG提供思路。 什么是字符集 一、疑惑 相信很多对字符集编码不够了解的程序员经常会出现很多乱码问题,抱有很多疑惑。 比如,为什么会出现乱码? 这里用的是什么字符编码? 创建一个文本它是GBK编码还是UTF-8编码? (创建文本文件默认使用ANSI,就是系统默认编码方式,中文windows系统默认使用GBK编码方式) 我应该使用GBK编码还是UTF-8编码? Unicode和UTF-8的区别是什么? 那么看完这篇文章,相信这些问题都可以迎刃而解。 二、基础概念 字节 这个是最基本的概念了, 字节 是计算存储容量的一种计量单位。我们知道计算机只能识别1和0组成的二进制位。一个数就是1位(bit),为了方便计算

Convert ISO-8859-1 to UTF-8 using groovy

南楼画角 提交于 2019-12-04 18:27:00
问题 i need to convert a ISO-8859-1 file to utf-8 encoding, without loosing content intormations... i have a file which looks like this: <?xml version="1.0" encoding="ISO-8859-1" ?> <HelloEncodingWorld>Üöäüßßß Test!!!</HelloEncodingWorld> Not i want to encode it into UTF-8. I tried following: f=new File('c:/temp/myiso88591.xml').getText('ISO-8859-1') ts=new String(f.getBytes("UTF-8"), "UTF-8") g=new File('c:/temp/myutf8.xml').write(ts) didnt work due to String incompatibilities. Then i read

关于乱码问题的一些思考

依然范特西╮ 提交于 2019-12-04 15:41:42
前言 从长沙辞职跑到深圳,找房子找工作适应新的工作环境超级忙。之前一直没时间好好写博客,今天难得有空就上来写点东西吧! 都9102年了,没想到还能有那么多乱码问题。之前的工作基本上前后端统一编码就完事了;话不多说,既然遇到了就干脆搞搞明白吧! 编码解码概述 我们都知道计算机不能直接存储字母,数字,图片,符号等,计算机能处理和工作的唯一单位是"比特位(bit)",一个比特位通常只有 0 和 1。利用比特位序列来代表字母,数字,图片,符号等,我们就需要一个存储规则,不同的比特序列代表不同的字符,这就是所谓的"编码"。反之,将存储在计算机中的比特位序列(或者叫二进制序列)解析显示出来成对应的字母,数字,图片和符号,称为"解码",如同密码学中的加密和解密,下面将详细解释编码解码过程中涉及到的一些术语: 字符集合 (Character set):是各种文字和符号的总称,包括各国家文字、标点符号、图形符号、数字等,简单理解就是一个字库,与计算机以及编码无关。 字符编码集 (Coded character set):是一组字符对应的编码(即数字),为字符集合中的每一个字符给予一个数字,如 Unicode 为每一个字符分配一个唯一的码点与之一一对应。 字符编码 (Character Encoding):简单理解就是一个映射关系,将字符集对应的码点映射为一个个二进制序列,从而使得计算机可以存储和处理

JSP中文乱码问题解决方法小结

喜欢而已 提交于 2019-12-04 05:53:06
在使用JSP的过程中,最使人头疼的一个问题就是中文乱码问题,以下是我在软件开发中遇到的乱码问题以及解决方法。 1、JSP页面乱码   这种乱码的原因是应为没有在页面里指定使用的字符集编码,解决方法:只要在页面开始地方用下面代码指定字符集编码即可,<%@ page contentType="text/html; charset=gb2312"? %> 2、数据库乱码   这种乱码会使你插入数据库的中文变成乱码,或者读出显示时也是乱码,解决方法如下:   在数据库连接字符串中加入编码字符集   String Url="jdbc:mysql://localhost/digitgulf?user=root&password=root&useUnicode=true&characterEncoding=GB2312";   并在页面中使用如下代码:   response.setContentType("text/html;charset=gb2312");   request.setCharacterEncoding("gb2312"); 3、中文作为参数传递乱码   当我们把一段中文字符作为参数传递个另一页面时,也会出现乱码情况,解决方法如下:   在参数传递时对参数编码,比如   RearshRes.jsp?keywords=" + java.net.URLEncoder.encode

jQuery AJAX call messes up character encoding

与世无争的帅哥 提交于 2019-12-04 05:33:12
I have a servlet that outputs JSON. The output encoding for the servlet is ISO-8859-1. Pages in our webapp are also set to ISO-8859-1. I would use UTF-8, but this is outside my control; we have to use ISO-8859-1. When I hit the servlet by itself, I can see JSON data that has been outputted. The character encoding is correct, and none of the characters look strange. However, when I call the servlet via AJAX and use the data retrieved to populate a select box, I get � in the place of (it seems) all characters that have accents (for example i with grave or acute accent, dieresis, or circumflex).