iso-8859-1

How to correctly return special Spanish characters from a MS Access db with jdbc-odbc driver

倖福魔咒の 提交于 2019-12-11 12:52:43
问题 How can you return special characters from a Ms access (.accdb or .mdb) database using the jdbc-odbc driver for MS Acess databases? Converting from bytes of the result set( bytes[] bt = rs.getbytes(index_of_field) and then new String (bt, "UTF-8") or even new String (bt, "iso-8859-1") ) or getting the string ( rs.getString() ) won't work and you need a valid way to do it. 回答1: The way to get special characters like (some other special characters may also be returned successfully, however,

Encoding issue when handling a string that contains “question mark” (�)

五迷三道 提交于 2019-12-11 05:49:40
问题 I am parsing some web content in a response from a HttpWebRequest . This web content is using charset ISO-8859-1 and when parsing it and finally getting the word needed from the response, I am receiving a string with a question mark like this � and I want to know which is the right way to transform it back into a readable string . So, what I've tried is to convert the current word encoding into UTF-8 like this: (I am wondering if UTF-8 could solve my problem) string word = "ESPA�OL"; Encoding

Conversion between UTF-8 and ISO 8859-1:

一个人想着一个人 提交于 2019-12-11 04:15:55
问题 I found the following code in SO. Does this really work? String xml = new String("áéíóúñ"); byte[] latin1 = xml.getBytes("UTF-8"); byte[] utf8 = new String(latin1, "ISO-8859-1").getBytes("UTF-8"); I mean, latin1 is UTF-8-encoded in the second line, but read als ISO-8859-1-encoded in the third? Can this ever work? Not that I did not want to criticize the cited code, I am just confused since I ran into some legacy code that is very similar, that seems to work, and I cannot explain why. EDIT: I

(javascript / google scripts) How to get the title of a page encoded with iso-8859-1 so that the title will display correctly in my utf-8 website?

◇◆丶佛笑我妖孽 提交于 2019-12-11 03:52:19
问题 I'm asking for help because I really spent hours (more than 5) to look for an answer online and can't find the proper solution. My project requires that I scrap the titles of a external web pages, but sometimes these pages are coded in iso-8859-1. As the scrapped titles are displayed in my page code in utf-8, I get � instead of characters such as é, à, ê, ô ... So I must find a way to sometimes convert the titles from iso-8859-1 to utf-8. Can you help me? I'm scripting with Google Scripts, e

MySQLdb can't initialize character set utf-8 error

天涯浪子 提交于 2019-12-11 01:04:28
问题 I am trying to insert some Arabic word into the arabic_word column of my hanswehr2 database Maria DB using the MySQLdb driver. I was getting a latin-1 encode error . But after reading around, I found out that the MySQLdb driver was defaulted to latin-1 and I had to explicitly set utf-8 as my charset of choice at the mariadb.connect() function. Sauce. The entire database is set to utf-8. Code: def insert_into_db(arabic_word, definition): try: conn = mariadb.connect('localhost', 'root',

How can I convert iso-8859-1 to utf8 correctly?

老子叫甜甜 提交于 2019-12-10 21:10:14
问题 I need to write a response stream to a file. The stream contains an encoded page (iso-8859-1). This is my code: ... using (TextWriter writer = new StreamWriter(tmpFilePath)) { using (TextReader reader = new StreamReader(answer, Encoding.GetEncoding("ISO-8859-1"))) { string line = ""; while ((line = reader.ReadLine()) != null) { // try to decode string decoded_line = decode(line); writer.WriteLine(decoded_line); } } } ... string decode(string message) { string result = ""; Encoding iso =

Will iso-8859-1 display german umlauts ok or do I need to use utf-8?

主宰稳场 提交于 2019-12-10 17:10:03
问题 I have a multi language website that is hosted on a server that appears to have character encoding set to default to iso-8859-1. I thought I would be best having the pages utf-8 and included a meta tag to declare this. Unfortunately this meta tag seems to get overridden and the page defaults to iso-8859. Many special characters in the German and Dutch pages are not showing correctly. Do I need to try and change the server default to utf-8 or something? Maybe I could remove the server default

Setting ISO-8859-1 encoding for a single Tapestry 4 page in application that is otherwise totally UTF-8

亡梦爱人 提交于 2019-12-10 15:34:58
问题 I have a Tapestry application that is serving its page as UTF-8. That is, server responses have header: Content-type: text/html;charset=UTF-8 Now within this application there is a single page that should be served with ISO-8859-1 encoding. That is, server response should have this header: Content-type: text/html;charset=ISO-8859-1 How to do this? I don't want to change default encoding for whole application. Based on google searching I have tried following: @Meta({ "org.apache.tapestry

Any way to convert a regular string in ActionScript 3 to a ByteArray of Latin-1 Character Codes?

醉酒当歌 提交于 2019-12-10 13:12:15
问题 I am having no problem converting a string to a byteArray of UTF-16 encoded characters, but the application I am trying to communicate with (written in Erlang) only understands Latin-1 encoding. Is there any way of producing a byteArray full of Latin-1 character codes from a string within Actionscript 3? 回答1: byteArray.writeMultiByte(string, "iso-8859-1"); http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/utils/ByteArray.html#writeMultiByte() 来源: https://stackoverflow.com

Javamail ISO-8859-1 formatting

大兔子大兔子 提交于 2019-12-10 10:13:28
问题 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