character-encoding

Bad encoding of streamed CSV with Stripes / Tomcat

我只是一个虾纸丫 提交于 2019-12-24 09:38:54
问题 Actually i'm trying to stream a CSV file. I set the encoding to windows-1252 but it seems it is still streamed as UTF-8 file. final String encoding = "windows-1252"; exportResolution = new StreamingResolution(builder.getContentType() + ";charset=" + encoding.toLowerCase()) { @Override public void stream(HttpServletResponse response) throws Exception { // Set response headers response.setHeader("Cache-control", "private, max-age=0"); response.setCharacterEncoding(encoding); OutputStream os =

SQL Server 2014 - Parsing XML with Cyrillic Characters

杀马特。学长 韩版系。学妹 提交于 2019-12-24 09:17:08
问题 I'm parsing an xml file but have problem with cyrillic characters: this is the relevant part of the stored Procedure SOAP input to parse: '<?xml version="1.0"?> <soapenv:Envelope xmlns:.......> <soapenv:Header> </soapenv:Header> <soapenv:Body> <GetResponse> <BuyerInfo> <Name>Polydoros Stoltidys</Name> <Street>Луговой проезд дом 4 корпус 1 квартира 12</Street> </BuyerInfo> </GetResponse> </soapenv:Body> </soapenv:Envelope>' Stored Procedure CREATE PROCEDURE dbo.spXML_ParseSOAP ( @XML XML ) AS

XML parsing error related to char encoding set

你说的曾经没有我的故事 提交于 2019-12-24 08:58:02
问题 I have an valid XML file(valid cause browser can parse it) that I try to parse using JDOM2. The code was running good for other xml files but for this particular xml file it gives me the following exception on builder.build() line : "com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 3 of 3-byte UTF-8 sequence. " My code is as follows import java.io.*; import java.util.*; import java.net.*; import org.jdom2.*; import org.jdom2.input.*; import org.jdom2

PDF Asian character support - JasperReports

给你一囗甜甜゛ 提交于 2019-12-24 07:48:52
问题 I am trying to provide Asian character support for PDF documents created using Jasper Reports. I have tried configuring jasper to use Asian character encoding with the iText-Asian libraries to no avail. For all of the different charsets I used the Asian characters always appear blank. Has anyone successfully configured jasper reports to displayed Asian characters in PDF documents? If so How?!! 回答1: Yes. Font Extensions are the answer to everything. Well, at least they are the answer to this.

How to change the coding for python array?

廉价感情. 提交于 2019-12-24 07:48:23
问题 I use the following code to scrape a table from a Chinese website. It works fine. But it seems that the contents I stored in the list are not shown properly. import requests from bs4 import BeautifulSoup import pandas as pd x = requests.get('http://www.sohu.com/a/79780904_126549') bs = BeautifulSoup(x.text,'lxml') clg_list = [] for tr in bs.find_all('tr'): tds = tr.find_all('td') for i in range(len(tds)): clg_list.append(tds[i].text) print(tds[i].text) When I print the text, it shows Chinese

Php/json: decode utf8?

不羁岁月 提交于 2019-12-24 07:13:39
问题 I store a json string that contains some (chinese ?) characters in a mysql database. Example of what's in the database: normal.text.\u8bf1\u60d1.rest.of.text On my PHP page I just do a json_decode of what I receive from mysql, but it doesn't display right, it shows things like "½±è§�" I've tried to execute the "SET NAMES 'utf8'" query at the beginning of my file, didn't change anything. I already have the following header on my webpage: <meta http-equiv="Content-Type" content="text/html;

Wrong charset in ASP classic loaded via AJAX

狂风中的少年 提交于 2019-12-24 06:39:08
问题 I have issue with dynamic loading of part of content on ASP classic page. I use AJAX to load on page dynamically, depending on dropdown selected option. Generated contains some Labels for containing dropdowns and option text inside of dropdowns. Labels are constants encoded in UTF-8 and contain some western European accented characters, and option texts are loaded from database, contain accented characters too but are coded in ANSI. tags are set to utf-8 but it affects only first load of page

Special characters break json returned to jQuery

我是研究僧i 提交于 2019-12-24 06:27:45
问题 The following jQuery ajax function runs a PHP script that queries a MySQL database containing entries that are encoded as UTF-8: function searchLocations() { var stateSelected = $("#stateSelect").val(); $.ajax({ url: 'ajax/json.php', dataType: 'json', data: 'state='+stateSelected, success: function(data) { placeMarkers(data.markerdata.markers); } }); } The JSON object returned to the function contains the longitudes and latitudes of map marker objects as well as a name to display in an info

String Comparison using PHP mysql_* SET NAMES UTF 8 and Mysql Table With utf8_unicode_ci

拜拜、爱过 提交于 2019-12-24 06:01:27
问题 I have a Mysql table with column State - the states are from across Europe - and the table and columns are in utf8_unicode_ci . When I call the database I use mysql_select_db($database_WTF, $WTF); mysql_query('SET NAMES utf8'); $query_Recordset1 = "SELECT * FROM newmeets WHERE newmeets.`State` IS NOT NULL AND newmeets.`State` != '' ORDER BY newmeets.`State` ASC "; I then run it though this simple loop mysql_select_db($database_WTF, $WTF); mysql_query('SET NAMES utf8'); $query_Recordset1 =

é becomes &195;#169 and then becomes é How do I fix this encoding issue?

Deadly 提交于 2019-12-24 05:34:18
问题 I have a java file in Eclipse that is in UTF-8 and has some strings containing accents. In the java file itself, the accent is written and saved as é . In the xml that is generated using velocity the é becomes é In the pdf that is generated using fop and and an xsl template, the output is displayed as é So this is probably an encoding issue and everything should be in UTF-8. What's weird is that locally in my eclipse environment (windows) where I run the application, the whole process works