encoding

Jekyll encoding name of category special characters

≡放荡痞女 提交于 2021-02-18 17:09:28
问题 My Jekyll installation used to work. Since an update, I face an issue with URL containing tag names which have some special characters. I now get an error message when trying to reach a URL with special characters in it like http://127.0.0.1:4000/tag/Actualit%C3%A9%20europ%C3%A9enne/ , where Actualité européenne is the name of a category. The error message is incompatible character encodings: UTF-8 and ASCII-8BIT . All the files in _posts directory are utf-8. Here is the stack trace : [2017

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe7 in position 0: ordinal not in range(128)

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-17 15:20:42
问题 I'm having troubles in encoding characters in utf-8. I'm using Django, and I get this error when I tried to send an Android notification with non-plain text. I tried to find where the source of the error and I managed to figure out that the source of the error is not in my project. In python shell, I type: 'ç'.encode('utf8') and I get this error: Traceback (most recent call last): File "<stdin>", line 1, in <module> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe7 in position 0:

Convert Unicode characters to extended ASCII

醉酒当歌 提交于 2021-02-16 14:56:09
问题 I have some binary data that had to be percent encoded to transfer to a remote service via a length-restricted query string parameter. When it comes back to me some of the values are encoded like this: \u2014 I wish to convert this value back to binary data. The Unicode character is the same as the original value in extended ASCII. How can I convert the above back to extended ASCII? Edit: Windows-1252 I would prefer a Javascript solution but can work with: PHP, Python, C, C++. 回答1: Here's the

Decoding and Encoding issue. Different implementations of Base64 Class in android.util.* and java.util.*?

廉价感情. 提交于 2021-02-16 06:10:08
问题 I am writing an App which does the following with a given String str: encode(encrypt(encode(stringToBytearray(str)))); The Server receives the Base64 encoded String, which is then decoded -> decrypted -> decoded, to get the sent String str from the App. Unfortunately it doesnt work for all Strings, long Strings lead to a long Base64 String and my Server throws the following Exception: Exception in thread "main" java.lang.IllegalArgumentException: Illegal base64 character 5b at java.util

PHP: Unicode accentuated char and diacritics

扶醉桌前 提交于 2021-02-15 11:44:15
问题 In our website, some Mac users have troubles when they copy-paste text from PDF files into a TextArea (handled by TinyMCE). All accentuated char are corrupted, and became for example e? for a é , i? for a î , etc. I cannot reproduce this problem with a Windows computer. When I wrote the content of the TextArea on a file (before inserting it in the database), I just discovered that the initial é is visually different that a traditionnal é (on Vim, see below). Indeed : // the corrupted é -

PHP: Unicode accentuated char and diacritics

左心房为你撑大大i 提交于 2021-02-15 11:44:15
问题 In our website, some Mac users have troubles when they copy-paste text from PDF files into a TextArea (handled by TinyMCE). All accentuated char are corrupted, and became for example e? for a é , i? for a î , etc. I cannot reproduce this problem with a Windows computer. When I wrote the content of the TextArea on a file (before inserting it in the database), I just discovered that the initial é is visually different that a traditionnal é (on Vim, see below). Indeed : // the corrupted é -

Python encoding and json dumps

时光怂恿深爱的人放手 提交于 2021-02-12 11:28:06
问题 I apologize if this question has been asked earlier. I am still not clear about encoding in python3.2. I am reading a csv(encoded in UTF-8 w/o BOM) and I have French accents in the csv. Here is the code to opening and reading the csv file: csvfile = open(in_file, 'r', encoding='utf-8') fieldnames = ("id","locale","message") reader = csv.DictReader(csvfile,fieldnames,escapechar="\\") for row in reader: if row['id'] == id and row['locale'] == locale: out = row['message']; I am returning the

How to change encoding from UTF-8 to UTF-8-BOM of exported *.txt files from Excel?

落花浮王杯 提交于 2021-02-11 18:19:39
问题 Exported text files from Excel are encoded with UTF-8. An encoding UTF-8-BOM is needed. I think that in code shall be inserted a row, written like: Java ?xml version="1.0" encoding="UTF-8"? Jasperreport CSV UTF-8 without BOM instead of UTF-8 or HTML5 meta charset="utf-8" Bad UTF-8 without BOM encoding Sub export_data() Dim row, column, i, j As Integer Dim fullPath, myFile As String fullPath = "C:\Workspace" row = 21 column = 5 For i = 1 To column myFile = Cells(1, i).Value + ".txt" myFile =

Convert Latin characters from Shift JIS to Latin characters in Unicode

浪子不回头ぞ 提交于 2021-02-11 17:29:43
问题 I'm working on parsing files with Shift-JIS encoded strings within the binary data. My current code is this: public static string DecodeShiftJISString(this byte[] data, int index, int length) { byte[] utf8Bytes = Encoding.Convert(Encoding.GetEncoding(932), Encoding.UTF8, data); return Encoding.UTF8.GetString(utf8Bytes); } It works fine and I am able to get usable strings from this method, although when I display strings with Latin characters into my WinForms application, I see that the

Strange tabs-names characters in Eclipse IDE

烂漫一生 提交于 2021-02-11 14:40:44
问题 I am getting strange tabs-names characters in Eclipse IDE. (Operating system - Win10x64. Software - Eclipse x64 for java developers) Buggy tabs: Correct in the pop-up window: What may be the problem? 回答1: This is suggested by greg-449. The issue is described here. I have set every font (I don't know witch is required) as consolas and it worked for me. 来源: https://stackoverflow.com/questions/63151885/strange-tabs-names-characters-in-eclipse-ide