encoding

Convert UTF-16LE to UTF-8 in php

陌路散爱 提交于 2020-01-28 01:50:06
问题 I use iconv php function but some characters doesn't convert correctly: ... $s = iconv('UTF-16', 'UTF-8', $s); ... $s = iconv('UTF-16//IGNORE', 'UTF-8', $s); ... $s = iconv('UTF-16LE', 'UTF-8', $s); ... $s = iconv('UTF-16LE//IGNORE', 'UTF-8', $s); ... I also try mb_convert_encoding function but can't solve my problem. A sample text file: 9px.ir/utf8-16LE.rar 回答1: iconv supports the UTF-16LE encoding. You can use it to transpose the encoding from UTF-16LE to UTF-8 : $result = iconv($in_charset

Email from PHP has broken Subject header encoding

落爺英雄遲暮 提交于 2020-01-26 09:43:57
问题 My PHP script sends email to users and when the email arrives to their mailboxes, the subject line ( $subject ) has characters like a^£ added to the end of my subject text. This is obviously and encoding problem. The email message content itself is fine, just the subject line is broken. I have searched all over but can’t find how to encode my subject properly . This is my header. Notice that I’m using Content-Type with charset=utf-8 and Content-Transfer-Encoding: 8bit . //set all necessary

Email from PHP has broken Subject header encoding

天涯浪子 提交于 2020-01-26 09:39:39
问题 My PHP script sends email to users and when the email arrives to their mailboxes, the subject line ( $subject ) has characters like a^£ added to the end of my subject text. This is obviously and encoding problem. The email message content itself is fine, just the subject line is broken. I have searched all over but can’t find how to encode my subject properly . This is my header. Notice that I’m using Content-Type with charset=utf-8 and Content-Transfer-Encoding: 8bit . //set all necessary

How to set body parameter for Alamofire swift - Parameters Issue

╄→尐↘猪︶ㄣ 提交于 2020-01-26 03:59:26
问题 I am really struggling to set body parameter for posting data to server. I have different json encoding references but its not working. Anybody please suggest. Issue is after passing values into parameter SectionList model gives backslashes and over all parameters not serialized. My values are : AppID ApprovDT UnitId SectionList (Model as I encode it to JSON). Variable Code: let someDate = Date() let approvDT = Int(someDate.millisecondsSince1970) let unitId = id let AppID = UserDefaults

Meaning of `<meta charset=“B”>` in an HTML document

…衆ロ難τιáo~ 提交于 2020-01-25 21:51:31
问题 I am learning HTML now, and one aspect related to the encoding confuses me. Imagine, I open my test editor, write some HTML code and save it using charset A (e.g. UTF-8 or ANSI or something else). Then in my view the following happens: all characters I have typed are mapped to certain numbers, the mapping is specified by the charset A ; the numbers are saved in the computer memory in their binary representation as sequences of 0 s and 1 s. In the HTML document I have just saved there is a

Meaning of `<meta charset=“B”>` in an HTML document

本小妞迷上赌 提交于 2020-01-25 21:50:11
问题 I am learning HTML now, and one aspect related to the encoding confuses me. Imagine, I open my test editor, write some HTML code and save it using charset A (e.g. UTF-8 or ANSI or something else). Then in my view the following happens: all characters I have typed are mapped to certain numbers, the mapping is specified by the charset A ; the numbers are saved in the computer memory in their binary representation as sequences of 0 s and 1 s. In the HTML document I have just saved there is a

Coding a path in unicode c++

痞子三分冷 提交于 2020-01-25 13:26:06
问题 I had a problem with opening UTF-8 path files. Path that has a UTF-8 char (like Cyrillic or Latin). I found a way to solve that with _wfopen but the way a solved it was when I encode the UTF-8 char with UTF by hand (\Uxxxx). Is there a function, macro or anything that when I supply the string (path) it will return the Unicode?? Something like this: https://www.branah.com/unicode-converter I tried with MultiByteToWideChar but it returns some Hex numbers that are not relavent. Tried: std:

Text file encoding to UTF_8?

左心房为你撑大大i 提交于 2020-01-25 12:28:07
问题 I'm writing a Java project sending email with attachment. In my test case, I add some Japanese words "some Hiraganas and Katakanas" to my attached testfile.txt (which I saved in UTF-8 encoding.) But when I send my test email to myself, after I opened the attached testfile.txt, every Japanese Chars turns to be "????". So I'm just wondering why this happens...? Thank you Allan P.S. to be more specific, here is my code. I am using mail.jar to send email. Here is how I get the file: /** * Add an

How can I convert a string to the idna coded, encoding with 'idna' coded failed

蹲街弑〆低调 提交于 2020-01-25 10:17:12
问题 I have a string, which should be a stmp server in a later step for python. The string is (little anonymized): outlook-stg.d-a-tf.de/mapi/emsmdb/?MailboxId=cf27be4f-8605-40e4-94ab-d8cea3cc03bc@test.com For sure the error is: UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long) Which I understand is a problem with the name how I want to adress the server: label empty or too long - python urllib2 But how can I convert it in the right format? I also tried:

Is iso-8859-1 supported in Silverlight?

℡╲_俬逩灬. 提交于 2020-01-25 10:08:08
问题 this is a simple question: does Silverlight (3.0?) support this kind of encoding? Encoding c = Encoding.GetEncoding("iso-8859-1"); Calling this function in Silverlight 3.0 generate the following error. 'ISO-8859-1' is not a supported encoding name. Parameter name: name My idea is to parse some file client side and then upload only those part needed for my application. I know that I could upload the whole file and parse it server side but right now could be better having the feature client