character-encoding

Docker Jenkins slave wrong character encoding

徘徊边缘 提交于 2019-12-25 09:09:27
问题 I'm using this Jenkins slave docker image, it is based on ubuntu:14.04 I would like to use a String Parameter which contains UTF-8 characters. The charachers like öüóőúűáéí (Hungarian characters) will be replaced to question marks As this ticket mentions I tried to pass -e LANG=hu_HU.UTF-8 and bash -c "locale-gen hu_HU.UTF-8" to docker. I also placed export LANG=hu_HU.UTF-8 to Jenkins user's .bashrc the characters are still replaced. I also tried with en_US.UTF-8 I also tried to do the same

PHP: Updating with öäå into MySQL

China☆狼群 提交于 2019-12-25 08:33:24
问题 I already have done this: mysql_set_charset("utf8",$link); at the connection mysql_query("SET NAMES 'UTF8'"); at the connection + on every table in database changing from latin1 to utf8 collation + character for every table + columns file have meta utf8 + header('Content-Type: text/html; charset=utf-8'); plus the files itself are formatted in utf-8( without bom) where link is mysql_connect(), it shows the öäå characters fine when i take them out from database, but when i try to mysql_query

How to maintain character-set of standard-values when uploading MySQL-dump

谁说我不能喝 提交于 2019-12-25 07:58:16
问题 I have a MySQL4 database db4 (charset: latin1) which I want to copy to a MySQL5 database (standard charset: utf-8) db5 using the following command: mysqldump -u dbo4 --password="..." --default-character-set="latin1" db4 | mysql -S /tmp/mysql5.sock -u dbo5 --password="..." --default-character-set="latin1" db5 The values of the entries are copied in a correct way. But the the german Umlaute (äüö...) which are contained in standard-values of some fields, are afterwards schown as "?" What is

iconv_set_encoding() deprecated broke needed function

為{幸葍}努か 提交于 2019-12-25 07:49:47
问题 I used to have this nice little function to translate weird ISO-8895-15 characters to UTF-8 in a string so it wont break RSS/Atom feeds function convertCharset($contents) { iconv_set_encoding("internal_encoding", "ISO-8859-15"); iconv_set_encoding("output_encoding", "ISO-8859-1"); ob_start("ob_iconv_handler"); echo $contents; $contents = ob_get_clean(); $contents = strtr($contents, array( "\x80" => "e", "\x81" => " ", "\x82" => "'", "\x83" => 'f', "\x84" => '"', "\x85" => "...", "\x86" => "+"

How to read GB2312 encoded text files using Swift 3.0

十年热恋 提交于 2019-12-25 07:47:39
问题 My app needs to read text files encoded in GB2312. Here is the current code. SGFString = try String(contentsOf:path) It throws an exception. couldn’t be opened because the text encoding of its contents can’t be determined. While looking into the String.Encoding values, there is no GB2312. What would be the best way to read the GB2312 text files? Thanks Ray 回答1: Thanks for OOPer's help. I copied some of the code from the links, now it works. Here is the code: extension String.Encoding { static

Encoding/decoding non-ASCII character when using Python Pandas

丶灬走出姿态 提交于 2019-12-25 07:39:33
问题 I have some data with non-ASCII characters. I attempted to take care of it using the following: # coding=utf-8 import pandas as pd from pandas import DataFrame, Series import sys import re reload(sys) sys.setdefaultencoding('latin1') Though I have identified some records still giving me encoding/decoding problem. I have copied and pasted one of the problematic record (containing the name and location columns of the record) as below: 'Eugène Badeau' 'E, Québec (county/comté), Quebec, Canada

Python 2.7 connection to Oracle: loosing (Polish) characters

那年仲夏 提交于 2019-12-25 07:27:17
问题 I connect from Python 2.7 to Oracle data base. When I use: cursor.execute("SELECT column1 FROM table").fetchall()] I have got almost proper values for column1 because all Polish characters ("ęóąśłżćń") are converted to ascii one ("eoaslzcn"). Using another tool like SQLDeveloper and using the same select statement I get proper value. 回答1: Try setting the environment variable NLS_LANG to your database language string, something like os.environ['NLS_LANG'] = 'POLISH_POLAND.EE8MSWIN1250' 回答2:

PHP PDO Keep Getting Error: Charset=UTF8 : An invalid keyword charset was specified in the dsn string

≡放荡痞女 提交于 2019-12-25 07:23:47
问题 I keep getting this error : PHP PDO : Charset=UTF8 : An invalid keyword charset was specified in the dsn string. My code is like this function ConnectToSQLAndGetDBConnSTRVar() { try { $dbname = "irina"; $serverName = ".\SQLEXPRESS"; $username = "USERNAME"; $pw = "PASSWORD"; $dbh = new PDO ("sqlsrv:server=$serverName;Database=$dbname;charset=utf8","$username","$pw"); return $dbh; } catch (PDOException $e) { print "Failed to get DB handle: " . $e->getMessage() . "\n"; exit; } } And it doesnt

How to set the charset to UTF-8 for a received http variable in PHP?

左心房为你撑大大i 提交于 2019-12-25 07:21:06
问题 How to set the charset to UTF-8 for a received http variable in PHP? I have a html form using the POST methode with 1 input field. But when i submit the form and echo the retrieved the contents from the input field via $_POST['input_name'] i get this: KrkiÄ - but i entered (and i need) this: Krkič So how can i fix this? I figured it out now. :) If i want to add the contents to MYSQL then i need to add this: if(!$mysqli->set_charset("utf8")){ printf("Error loading character set utf8: %s\n",

Using iconv translit to convert from UTF-8 to CP1251

自闭症网瘾萝莉.ら 提交于 2019-12-25 07:19:36
问题 I'am trying to convert string " aÜ " from UTF-8 to CP1251 via C++ library iconv.h using TRANSLIT and as a result I get string " a? ", when expecting " aU ". When I use php script <?php echo iconv("UTF-8", "Windows-1251//TRANSLIT", "Ü");> on this computer, I get " aU " string as result. Here's the code: #include <cstdlib> #include <iconv.h> #include <locale.h> #include <stdio.h> #include <string.h> #include <errno.h> using namespace std; int IConvert(char *buf,char *outbuf, size_t len, const