character-encoding

Changing charset when retrieving messages from mail server!

时间秒杀一切 提交于 2019-12-24 11:36:04
问题 i'm currently creating a little mail client and facing a problem with charset. I use indy's TIdIMAP4 component to retrieve data from mail-server. When i try to retrieve mail bodies then accent letters like ä, ü etc are converted to =E4, =FC respectively as it is using charset ISO-8859-1. Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable How can i make server to send me data in another charset, like utf-8? What would be the best solution for that

Google Analytics Character encoding of __utm cookies

荒凉一梦 提交于 2019-12-24 11:19:59
问题 I'm trying to figure out what encoding GA uses when it saves cookies. For example, I can use non-western characters when setting the utm_source parameter and they show up fine in the GA reports. However, if I look at the __utmz cookie, it does not match the value for utm_source parameter, instead is seems to be encoded somehow, I know there is URL encoding, but this is something different. Example: 1) Visit www.example.com?utm_source=ХЦЧШЩЬЫЪЭЮЯ 2) View cookies. The __utmz cookie saves

Java- How to verify if Thai characters are encoded correctly from UTF-8 to TIS620

痴心易碎 提交于 2019-12-24 11:18:34
问题 Get input string in UTF-8, I applied TIS620 encoding and created new string from it now how to retain the bytes? since UTF-8 represents Thai char in 3 bytes where as TIS620 in 1 byte. I've requirement where the backend system stores characters in string as 1 byte only so default UTF-8 breaks it. How to convert String character encoding from UTF-8 to TIS620? How to retain the byte size while passing it to backend system? If the string is reassigned to new String , Does character encoding is

How to implement Baudot encoding

风流意气都作罢 提交于 2019-12-24 11:08:59
问题 I'm trying to implement a Baudot character encoding (a 6 bit per character code) in .Net. It's for a Cospas Sarsat device. I've started by deriving from the Encoding class: public class BaudotEncoding : Encoding { I'm looking for a simple, efficient way to implement a bidirectional character map (the map can be readonly): Dictionary<char, int> CharacterMap = new Dictionary<char, int> { { ' ', 0x100100 }, { '-', 0x011000 }, { '/', 0x010111 }, { '0', 0x001101 }, { '1', 0x011101 }, { '2',

character encoding puzzle with PHP/MS Access

蹲街弑〆低调 提交于 2019-12-24 10:46:08
问题 NB This is MS Access 2000, and this PHP file is called with an ajax call... At the start of this PHP file I have put ini_set('default_charset', 'utf-8'); The $token below comes from these lines $search_string = $_GET[ 'search_string' ]; $search_tokens = explode( " ", $search_string ); $token = $search_tokens[ 0 ]; This works OK when I have a "token" without French accented characters: $sql="SELECT * FROM tblFrEng WHERE French = '$token'"; echo "=== SQL is $sql<br>"; $sth = $dbh->prepare( $sql

VBA selective conversion of double-byte to single-bye characters

允我心安 提交于 2019-12-24 10:45:53
问题 I've written my first VBA sub, and it's KIND OF working the way it's supposed to, but I cannot figure out the part that's wrong. It's supposed to selectively convert double-byte spaces, letters, numbers, and punctuation to single-byte when there is a string of double-byte Japanese and Latinate characters and spaces. In this picture, the top row represents the input and the bottom row the desired output of spaces, letters, numbers, and punctuation converted to single-byte while the Japanese

jQuery ajax + responseText + Character encoding

為{幸葍}努か 提交于 2019-12-24 10:40:17
问题 I perform an AJAX request to a PHP script in JavaScript and by using the jQuery library. Here is my command which performs the AJAX request : $.ajax({ async: "false", cache: "false", data: {login: strLogin, password: strPassword}, datatype: "text", error: connexionAjaxError, success: connexionAjaxSuccess, type: "POST", url: "./Connexion" }); ".Connexion" is a URL redirection to my PHP script. connexionAjaxError is a JavaScript function inevitably executed as soon as the HTTP response is

Discover the character encoding from byte

喜夏-厌秋 提交于 2019-12-24 10:27:58
问题 I have a string where I know that the degree symbol (°) is represented by the byte 63 (3F). Each character is represented by a single byte. How can I find the character encoding used ? 回答1: Almost all 8-bit encodings in modern times coincide with ASCII in the ASCII range, so byte 3F hexadecimal is the question mark “?”. As Sebtm’s comment suggests, this might result from character-level data error. E.g., some software that is limited to ASCII could turn all other bytes to “?” – not a good

How to remove certain characters from HTML code using ASP

痞子三分冷 提交于 2019-12-24 09:58:50
问题 Just like the title says, how do I tell the page to output the HTML code and remove certain characters, such as this character ( ü ) 回答1: This is a method that removes diacritics: public static string RemoveDiacritics(this string input) { input = input.Normalize(NormalizationForm.FormD); StringBuilder output = new StringBuilder(); for (int i = 0; i < input.Length; i++) { if (CharUnicodeInfo.GetUnicodeCategory(input[i]) != UnicodeCategory.NonSpacingMark) output.Append(input[i]); } return

java - How to configure the output encoding in log4j 2.x programmatically?

∥☆過路亽.° 提交于 2019-12-24 09:57:35
问题 There are other questions about configuring programmatically log4j2, but I coun't find a way to configure the log output encoding? 回答1: I didn't solve it programatically. My solution was to execute the java interpreter with this option: java -Dfile.encoding=utf-8 回答2: In log4j one would do the following, so I assume too for log4j2: Logger hlogger = Logger.getLogger("org.hibernate.stat"); SimpleLayout layout = new SimpleLayout(); ConsoleAppender consoleAppender = new ConsoleAppender(layout);