utf-8

Having problems printing åäö (├Ñ ├à | ├ñ ├ä | ├ ├û)

て烟熏妆下的殇ゞ 提交于 2021-01-28 11:16:14
问题 I can't print the swedish letters åäö. #include <stdio.h> #include <stdlib.h> int main(void){ printf("å Å | ä Ä | ö Ö"); return 0; } The output I get is: ├Ñ ├à | ├ñ ├ä | ├ ├û I don't understand what is wrong. I've searched google and stackoverflow, but nothing to be found. Maybe there is something wrong with UTF-8? Other information that might be usefull: I'm using Windows 10 and atom. SOLUTION Go to: System language settings -> Administrative language settings -> Change system locale... Now

how are smileys encoded in mysql utf-8 mb4 database?

廉价感情. 提交于 2021-01-28 11:01:03
问题 I changed my mysql database to utf-8 mb4, so that users could enter smileys from their mobile phones / mac. It works (users can enter smileys and those smileys are shown in the web app on supported devices), but whenever I have a look at the table contents (via terminal or mysql workbench) it shows each smiley as a single question mark. How exactly are those smileys saved? I assume they got a utf-8 mb4 code, but is there any way to look at those? Thanks! 回答1: I suspect Workbench is running in

'utf-8' codec can't decode byte 0xe9 in position 4: unexpected end of data

吃可爱长大的小学妹 提交于 2021-01-28 10:32:17
问题 Im very new to this language and encountered some trouble to send emails through python, my code looks like this: import smtplib server=smtplib.SMTP("smtp.gmail.com",587) server.starttls() server.login('username','password') message = "hi there" server.sendmail('username', 'username', message) server.quit() my system is: Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32 and the output I get is: Traceback (most recent call last): File "C:\pythonfiles

'utf-8' codec can't decode byte 0xe9 in position 4: unexpected end of data

*爱你&永不变心* 提交于 2021-01-28 10:26:00
问题 Im very new to this language and encountered some trouble to send emails through python, my code looks like this: import smtplib server=smtplib.SMTP("smtp.gmail.com",587) server.starttls() server.login('username','password') message = "hi there" server.sendmail('username', 'username', message) server.quit() my system is: Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32 and the output I get is: Traceback (most recent call last): File "C:\pythonfiles

Decoding a VIEWSTATE string with UTF-8 in Python 3

僤鯓⒐⒋嵵緔 提交于 2021-01-28 10:08:52
问题 I'm having trouble decoding a ASP.NET view state string in Python 3. When I try decoding the string using bash's base64 command, it decodes the string successfully and I'm able to see all the information I need (most of it is in Hebrew, meaning UTF-8). The view state is of course base64-encoded only and not encrypted. However, when I try do decode the string using Python's base64 library and then decoding the byte array to a UTF-8 string, I get an error message: UnicodeDecodeError: 'utf-8'

lxml encoding error when parsing utf8 xml

假装没事ソ 提交于 2021-01-28 09:19:23
问题 I'm trying to iterate through an XML file (UTF-8 encoded, starts with ) with lxml, but get the following error on the character 丂 : UnicodeEncodeError: 'cp932' codec can't encode character u'\u4e02' in position 0: illegal multibyte sequence Other characters before this are printed out correctly. The code is: parser = etree.XMLParser(encoding='utf-8') tree = etree.parse("filename.xml", parser) root = tree.getroot() for elem in root: print elem[0].text Does the error mean that it didn't parse

Powerbuilder: ImportFile of UTF-8 (Converting UTF-8 to ANSI)

牧云@^-^@ 提交于 2021-01-28 06:50:31
问题 My Powerbuilder version is 6.5, cannot use a higher version as this is what I am supporting. My problem is, when I am doing dw_1.ImportFile(file) the first row and first column has a funny string like this:  Which I dont understand until I tried opening the file and saving it to a new text file and trying to import that new file.which worked flawlessly without the funny string. My conclusion is that this is happening because the file is UTF-8 (as shown in NOTEPAD++) and the new file is

Writing to files in ASCII with Python3, not UTF8

谁都会走 提交于 2021-01-28 06:21:47
问题 I have a program that I created with two sections. The first one copies a text file with an integer in the middle of the file name in this format. file = "Filename" + "str(int)" + ".txt" the user can create as many copies of the file that they would like. The second part of the program is what I am having the problem with. There is an integer at the very bottom of the file that is to correspond with the integer in the file name. After the first part is done, I open each file one at a time in

how to write UTF8 data to xml file using RandomAccessFile?

笑着哭i 提交于 2021-01-28 05:30:36
问题 When trying to write some UTF8 data to a file, I end up with some garbage in the file. The code is as follows public static boolean saveToFile(StringBuffer buffer, String fileName, ArrayList exceptionList, String className) { log.debug("In saveToFile for file [" + fileName + "]"); RandomAccessFile raf = null; File file = new File(fileName); File backupFile = new File(fileName+"_bck"); try { if (file.exists()) { if (backupFile.exists()) { backupFile.delete(); } file.renameTo(backupFile); } raf

Python 3 itertools.islice continue despite UnicodeDecodeError

拜拜、爱过 提交于 2021-01-28 04:01:02
问题 I have a python 3 program that monitors a log file. The log includes, among other things, chat messages written by users. The log is created by a third party application which I cannot change. Today a user wrote "텋��텋��" and it caused the program to crash with the following error: future: <Task finished coro=<updateConsoleLog() done, defined at /usr/local/src/bserver/logmonitor.py:48> exception=UnicodeDecodeError('utf-8',... say "\xed\xa0\xbd\xed\xb1\x8c"\r\n', 7623, 7624, 'invalid