character-encoding

Error string encoding (Windows 10 + Visual Studio 2015 + Net 4.6)

前提是你 提交于 2020-01-13 09:53:49
问题 My code: Keys = new Dictionary<string, string>(); Keys.Add("Набег_0", "raid_0"); When I get Keys.ElementAt(0) , I have this: {[Íàáåã_0, raid_0]} . Of course, when I run the program, key = "Набег_0" is not defined and the program crashes with a System.Collections.Generic.KeyNotFoundException This code worked fine when I had Windows 8.1 + Visual Studio 2013 + net 3.5 How do I fix this? 回答1: You somehow convinced the C# compiler that your source code was written in code page 1251, the default

Problems with PHP Mailer header encoding

帅比萌擦擦* 提交于 2020-01-13 09:22:05
问题 <?php require_once('../class.phpmailer.php'); //include("../class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded iconv_set_encoding("internal_encoding", "UTF-8"); $mail = new PHPMailer(); $mail->CharSet = "utf8"; /* $body = file_get_contents('contents.html'); $body = eregi_replace("[\]",'',$body); */ $mail->IsSMTP(); // telling the class to use SMTP //$mail->Host = "mail.app-cpr.com"; // SMTP server //$mail->SMTPDebug = 2; // enables SMTP debug

Problems with PHP Mailer header encoding

╄→尐↘猪︶ㄣ 提交于 2020-01-13 09:21:27
问题 <?php require_once('../class.phpmailer.php'); //include("../class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded iconv_set_encoding("internal_encoding", "UTF-8"); $mail = new PHPMailer(); $mail->CharSet = "utf8"; /* $body = file_get_contents('contents.html'); $body = eregi_replace("[\]",'',$body); */ $mail->IsSMTP(); // telling the class to use SMTP //$mail->Host = "mail.app-cpr.com"; // SMTP server //$mail->SMTPDebug = 2; // enables SMTP debug

Python thinks a 3000-line text file is one line long?

六眼飞鱼酱① 提交于 2020-01-13 07:53:07
问题 I have a very long text file that I'm trying to process using Python. However, the following code: for line in open('textbase.txt', 'r'): print 'hello world' produces only the following output: hello world It's as though Python thinks the file is only one line long, though it is many thousands of lines long, when viewed in a text editor. Examining it on the command line using the file command gives: $ file textbase.txt textbase.txt: Big-endian UTF-16 Unicode English text, with CR line

What's “ANSI_X3.4-1968” encoding?

心已入冬 提交于 2020-01-13 07:51:46
问题 See following output on my system: [STEP 101] # python3 -c 'import sys; print(sys.stdout.encoding)' ANSI_X3.4-1968 [STEP 102] # [STEP 103] # locale LANG=C LANGUAGE=en_US:en LC_CTYPE="C" LC_NUMERIC="C" LC_TIME="C" LC_COLLATE="C" LC_MONETARY="C" LC_MESSAGES="C" LC_PAPER="C" LC_NAME="C" LC_ADDRESS="C" LC_TELEPHONE="C" LC_MEASUREMENT="C" LC_IDENTIFICATION="C" LC_ALL=C [STEP 104] # Googled but found very little info about it. Even Python's The Python Library Reference (v3.5.2) does not mention it.

How to make SoapUI json request work with german umlauts?

二次信任 提交于 2020-01-13 05:22:11
问题 We use SoapUI for many interfaces in our team project. We came across a problem with german special signs, called umlauts. When sending a POST request with Json body and a german umlaut, the we get com.fasterxml.jackson.databind.JsonMappingException . It cannot be parsed with com.fasterxml.jackson.databind.ObjectMapper . But when sending the same request using POSTMAN, then it works like a charm. We use @Consumes({MediaType.APPLICATION_JSON + "; charset=utf-8"}) annotations and Content-Type:

Can there be 2 different UTF-8 encodings for the same character?

笑着哭i 提交于 2020-01-13 03:48:08
问题 I'm writing an application that needs to transcode its input from UTF-8 to ISO-8859-1 (Latin 1). All works fine, except I sometimes get strange encodings for some umlaut characters. For example the Latin 1 E with 2 dots (0xEB) usually comes as UTF-8 0xC3 0xAB, but sometimes also as 0xC3 0x83 0xC2 0xAB. This happened a number of times from different sources and noting that first and last characters match what I expect, could there be an encoding rule that my library doesn't know about ? 回答1: $

mb_convert_encoding for russian in php

本小妞迷上赌 提交于 2020-01-12 19:02:08
问题 how to convert Russian character to utf-8 in PHP using mb_convert_encoding or any other method? 回答1: Did you try the following? Not sure if it works, though. mb_convert_encoding($str, 'UTF-8', 'auto'); 回答2: $file = 'images/да так 1.jpg';//this is in UTF-8, needs to be system encoding (Russian) $new_filename = mb_convert_encoding($file, "Windows-1251", "utf-8");//turn utf-8 to system encoding Windows-1251 (Russian) now your russian files should open your russian characters in php are already

Encoding issue, coverting & to & for html using php

痴心易碎 提交于 2020-01-12 13:59:44
问题 I have a url in html: <a href="index.php?q=event&id=56&date=128"> I need to turn it into a string exactly as: <a href="index.php?q=event&id=56&date=128"> I know how to do this with preg_replace etc, but is there a function in php that deals directly with encoding that I can use for other encoding issues such as &nsbp (or whatever it is, etc)? Ideally I would send my string into the function and it would output '&' instead of &amp. Is there a universal function for converting &TEXT; into an

Encoding issue, coverting & to & for html using php

断了今生、忘了曾经 提交于 2020-01-12 13:56:50
问题 I have a url in html: <a href="index.php?q=event&id=56&date=128"> I need to turn it into a string exactly as: <a href="index.php?q=event&id=56&date=128"> I know how to do this with preg_replace etc, but is there a function in php that deals directly with encoding that I can use for other encoding issues such as &nsbp (or whatever it is, etc)? Ideally I would send my string into the function and it would output '&' instead of &amp. Is there a universal function for converting &TEXT; into an