utf-8

utf8_encode does not produce right result

我是研究僧i 提交于 2020-01-03 04:34:49
问题 My problem is the following: I store an array, which has keys like "e", "f", etc. At some point, I have to get the value of the key. This works well. But if I want to store "í", "é", etc. as the keys, it won't produce the right result (results in �). My page has to be in UTF-8. Looking up the problem, I found out that utf8_encode should help my problem. It didn't: although it produced a more-readable character, it still totally differed from what I want. If important, phpinfo gives: Directive

XML encoding issue

爱⌒轻易说出口 提交于 2020-01-03 04:16:08
问题 I want to know whether there is quick way to find whether an XML document is correctly encoded in UTF-8 and does not contains any characters which is not allowed in XML UTF-8 encoding. <?xml version="1.0" encoding="utf-8"?> thanks in advance, George EDIT1: here is the content of my XML file, in both text form and in binary form. http://tinypic.com/view.php?pic=2r2akvr&s=5 I have tried to use tools like xmlstarlet to check, the result is correct (invalid because of out of range of UTF-8), but

Java handling special character in request.getParameter

删除回忆录丶 提交于 2020-01-03 03:40:08
问题 I am trying to get parameter in my java class that contain a special character. I have added it as follows <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> I have these two parameters: (1)3 –days System Admin (6EE SP1) training at VMware Bangalore location (2)Daiichi:eDossier – Phase1 new_6500004691 After submitting the page i get the perfect result,but two parameter names gets change as below: (1)Daiichi:eDossier ââ¬â Phase1 new_6500004691 (1)3 âdays

Can nginx re-encode XML documents, or alter XML headers?

耗尽温柔 提交于 2020-01-03 03:35:07
问题 I have a problem ultimately caused by a third party XML document whose actual encoding (ISO 8859-1 or Windows 1252, can't tell) doesn't match its declared encoding (UTF-8). I'm looking for creative workarounds. We already use nginx proxies for various content, so perhaps there is a way to either: Re-encode the document contents on the fly from ISO 8859-1 to UTF-8; or Alter the document header on the fly, from UTF-8 to ISO 8859-1. Are either of these possible with nginx? If not, a similar tool

Rails 3, Heroku: Taps Server Error: PGError: ERROR: invalid byte sequence for encoding “UTF8”: 0xba

牧云@^-^@ 提交于 2020-01-03 02:40:10
问题 I have a Rails 3.0.9 application running both locally in my dev env and remotely on a heroku app. I have a method that imports a CSV file into a model, and this file can contain non-english characters, like °,á,é,í, etc (it's in spanish). I am currently able to import the complete file (75k records) without any problems in my local dev (SQLite) database ; but, when uploading the db to heroku with heroku db:push , it fails with the error I'm posting in the title : !!! Caught Server Exception

Could Git correctly display ISO Latin 1 accents in a UTF-8 terminal?

只愿长相守 提交于 2020-01-03 01:58:09
问题 Fork from Don't display ^M (carriage return) in git grep output In my MinTTY (Cygwin on Windows), git grep display weird chars instead of accents: Upon verification, it seems that the filetype is: ISO-8859 text, with very long lines, with CRLF line terminators While my MinTTY is set up as UTF-8: # Text Font=Powerline Consolas FontHeight=9 BoldAsFont=yes BoldAsColour=yes AllowBlinking=yes Locale=C Charset=UTF-8 # Terminal Term=xterm-256color Of course, when grepping in files from different

How do I go about setting TextView to display UTF-8 when the String is not an embedded Resource?

浪子不回头ぞ 提交于 2020-01-03 01:55:22
问题 I'm encountering an odd situation whereby strings that I load from my resource XML file that have Spanish characters in them display correctly in my TextViews, but strings that I'm fetching from a JSON file that I load via HTTP at runtime display the missing char [] boxes ESPAÑOL for example, when embedded in my XML strings works fine, but when pulled from my JSON is rendered as SPAÃ[]OL, so the Ñ is transformed into a à and a missing char! I'm not sure at what point I need to intercept these

How to export Chinese characters encoded UTF-8 from MySql to SQL correctly

对着背影说爱祢 提交于 2020-01-02 17:41:10
问题 We are fighting with serious problem last three day, We exported our MySql database file from PhpmyAdmin, Data was written inside database entries is Chinese with UTF-8 Char-Set, After exporting its converted to Latin Char-Set, Now we are importing this Database SQl file to other host, We importing this data on on UTF-8 and Collation UTF-general-ci, But data is still in Latin Char i cant see Chinese, Moreover we tried almost all Charset in importing this SQL file, but still now result, Please

Reading Text with Accent - Python

一笑奈何 提交于 2020-01-02 16:53:40
问题 I did some script in python that connects to GMAIL and print a email text... But, often my emails has words with "accent". And there is my problem... For example a text that I got: "PLANO DE S=C3=9ADE" should be printed as "PLANO DE SAÚDE". How can I turn legible my email text? What can I use to convert theses letters with accent? Thanks, The code suggested by Andrey, works fine on windows, but on Linux I still getting the wrong print: >>> b = 'PLANO DE S=C3=9ADE' >>> s = b.decode('quopri')

Reading Text with Accent - Python

半城伤御伤魂 提交于 2020-01-02 16:53:09
问题 I did some script in python that connects to GMAIL and print a email text... But, often my emails has words with "accent". And there is my problem... For example a text that I got: "PLANO DE S=C3=9ADE" should be printed as "PLANO DE SAÚDE". How can I turn legible my email text? What can I use to convert theses letters with accent? Thanks, The code suggested by Andrey, works fine on windows, but on Linux I still getting the wrong print: >>> b = 'PLANO DE S=C3=9ADE' >>> s = b.decode('quopri')