iso-8859-1

How to get json_encode() to work with ISO-8859-1 (åäö)

这一生的挚爱 提交于 2019-12-09 02:53:09
问题 json_encode() wont work for me when I'm using åäö. Why? And how can I get it to work? The php : echo json_encode($arr); The javascript : var theResponse = JSON.parse(xmlHttp.responseText); When I alert() the response, and the response contains å, ä or ö, the response is = NULL Please, help me out... 回答1: It says in the json_encode() documentation: This function only works with UTF-8 encoded data. You should convert it to utf-8 with iconv or mbstring first. 回答2: As Greg mentioned, I had to

Java jaxb utf-8/iso convertions

蓝咒 提交于 2019-12-08 08:59:58
问题 I have a XML file that contains non-standard characters (like a weird "quote"). I read the XML using UTF-8 / ISO / ascii + unmarshalled it: BufferedReader br = new BufferedReader(new InputStreamReader( (conn.getInputStream()),"ISO-8859-1")); String output; StringBuffer sb = new StringBuffer(); while ((output = br.readLine()) != null) { //fetch XML sb.append(output); } try { jc = JAXBContext.newInstance(ServiceResponse.class); Unmarshaller unmarshaller = jc.createUnmarshaller();

JSP静态包含和动态包含的区别

天涯浪子 提交于 2019-12-07 15:50:32
jsp动态包含和静态包含实现的内容一样,但是实现的方式不同。 jsp静态包含<%@ include file="" %> 创建include1.jsp和include2.jsp   include1.jsp代码 <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ include file="include2.jsp"%> <!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Insert title here</title> </head> <body> this is include page 1 </body> </html>    include2.jsp代 <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Insert title here</title> </head> <body

Reading iso-8859-1 rss feed C# WP7

为君一笑 提交于 2019-12-07 07:56:47
问题 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

字符集与编码(八)——ASCII和ISO-8859-1

谁都会走 提交于 2019-12-07 03:44:10
在前面其实也谈到了ASCII了,但并没有很具体,作为一个完整系列的一部分,还是有必要谈一下,也作为后面讨论的一些基础。 ASCII 它的全称是 A merican S tandard C ode for I nformation I nterchange(美国信息交换标准代码),是一个7位字符编码方案。下面是它的一张简图(来自 http://www.asciitable.com/index/asciifull.gif ): ASCII定义了128个字符,包括33个不可打印的 控制字符(non-printing control characters) 和95个可打印的字符。 控制字符 32以下的及最后一个127是所谓的控制字符。(0x00~0x1F以及0x7F) 即上图最左边一列的32个字符及最右边一列最后的一个字符(DEL,删除) 熟悉的有0x09(TAB,horizontal tab,水平制表符),0x0A(LF,line feed,’\n’换行符),0x0D(CR,carriage return,’\r’回车符),其它的很多现在已经是废弃不用了。 关于回车换行(‘\r\n’),在屏幕还不普及的时代,结果输出经常是依赖于所谓的电传打印机, 打印头 沿着打印杆从左向右移动并打印出一个个字符,当碰到一个回车符时(CR,0x0D,’\r’),打印机就指示打印头重新回到最左边的位置上

What are the options to convert ISO-8859-1 / Latin-1 to a String (UTF-8)?

偶尔善良 提交于 2019-12-07 03:32:22
问题 I scanned the Rust documentation for some way to convert between character encodings but did not find anything. Did I miss something? Is it supported (directly or indirectly) by the Rust language and its standard libraries or even planned to be in the near future? As one of the answers suggested that there is an easy solution because u8 can be cast to (Unicode) char s. With Unicode being a superset of the codepoints in ISO-8859-1, thats a 1:1 mapping which encodes to multiple bytes in UTF-8

GoLang - Persist using ISO-8859-1 charset

纵然是瞬间 提交于 2019-12-06 09:41:54
问题 I'm developing a project where we need to persist our information in a legacy database that has ISO-8859-1 tables. So before writing something to the database I need to convert it from UTF-8 to ISO-8859-1, and every time I retrieve it from the database, I need to convert it back to UTF-8. I was trying to use the library code.google.com/p/go-charset/ as the following for each text field that I need to persist. import ( "bytes" "code.google.com/p/go-charset/charset" _ "code.google.com/p/go

C# convert ISO-8859-1 characters to entity number

偶尔善良 提交于 2019-12-06 09:33:58
问题 I can't seem to figure out how to convert ISO-8859-1 characters, such as é, to it's entity number being é . I want to be able to take a string, such as: "Steel Décor" and have it converted to: "Steel D é cor" 回答1: Assuming you don't care about HTML-encoding characters that are special in HTML (e.g., <, &, etc.), a simple loop over the string will work: string input = "Steel Décor"; StringBuilder output = new StringBuilder(); foreach (char ch in input) { if (ch > 0x7F) output.AppendFormat("&#

Java; Trying to convert a String which contains ISO-8859-1 encoding to UTF-8 but file is UTF-8

不羁的心 提交于 2019-12-06 08:18:29
I don't know if this is going to make sense but this is what I make of it. I'm working with Eclipse using UTF-8 encoding for all my files. In one of them I need to convert a String from ISO-8859-1 to UTF-8. However that string is formed within the file itself (doesn't come from input) which is why I believe my String starts out as UTF-8 and the conversion doesn't go the way i expected. The String original content is: ||3.2|2013-01-25T17:24:00|ingreso|PAGO EN UNA SOLA EXHIBICION|6386.21|MXN|7408.00|No identificado|NAUCALPAN DE JUÁREZ, ESTADO DE MEXICO|CAOS640116HT5|OSCAR MARTIN CARRERA|CTO.

Javamail ISO-8859-1 formatting

ぃ、小莉子 提交于 2019-12-06 00:04:56
I made an E- Mail Client for my Android phone with the Javamail Api. If I try to get the sender's mail address and the recipients mail address with the following methods: Address[] froma = m.getFrom(); String from = InternetAddress.toString(froma); Address[] toa = m.getRecipients(Message.RecipientType.TO); String to = InternetAddress.toString(toa); I get a String like this back: "Georg =?ISO-8859-1?Q?SP=E4the?= and it has to be Georg Späthe or Georg Spaethe. I think the Problem is that this are German Mails with another encoding. Can anybody help me to solve that problem? MIME headers are