utf-8

Why does PHP built-in web server not serve file called é.txt (on Windows)

删除回忆录丶 提交于 2020-01-02 16:29:39
问题 I'm on Windows 7 If I have a directory containing my file é.txt and I start the built-in web server in that directory php -S localhost:8000 then, using my web browser, I request the URL http://localhost:8000/é.txt the web server responds Not Found The requested resource /%C3%A9.txt was not found on this server. 回答1: PHP's Windows filesystem support is broken - it does not properly translate to the native encoding. See How do I use filesystem functions in PHP, using UTF-8 strings? 来源: https:/

Why does PHP built-in web server not serve file called é.txt (on Windows)

半世苍凉 提交于 2020-01-02 16:29:39
问题 I'm on Windows 7 If I have a directory containing my file é.txt and I start the built-in web server in that directory php -S localhost:8000 then, using my web browser, I request the URL http://localhost:8000/é.txt the web server responds Not Found The requested resource /%C3%A9.txt was not found on this server. 回答1: PHP's Windows filesystem support is broken - it does not properly translate to the native encoding. See How do I use filesystem functions in PHP, using UTF-8 strings? 来源: https:/

Search utf-8 string with Gmail X-GM-RAW IMAP command

允我心安 提交于 2020-01-02 15:14:39
问题 Gmail's imap extension command X-GM-RAW allows me to perform a search if I use a ascii query string. If utf-8 chars are used in the query, the imap returns bad response. https://developers.google.com/google-apps/gmail/imap_extensions#extension_of_the_search_command_x-gm-raw How should the utf-8 input string be encoded so that X-GM-RAW search will work fine. I do not want to loose the flexibility to search specific field like "subject" or "rfc833msgid" Thanks 回答1: Specify CHARSET UTF-8 and

Search utf-8 string with Gmail X-GM-RAW IMAP command

限于喜欢 提交于 2020-01-02 15:14:00
问题 Gmail's imap extension command X-GM-RAW allows me to perform a search if I use a ascii query string. If utf-8 chars are used in the query, the imap returns bad response. https://developers.google.com/google-apps/gmail/imap_extensions#extension_of_the_search_command_x-gm-raw How should the utf-8 input string be encoded so that X-GM-RAW search will work fine. I do not want to loose the flexibility to search specific field like "subject" or "rfc833msgid" Thanks 回答1: Specify CHARSET UTF-8 and

ISO6937 to UTF8 give wrong results in C#

邮差的信 提交于 2020-01-02 11:19:32
问题 I'm reading some binary data from file in C#, also strings which need to be correctly decoded. I have no problems with for example windows-1251 codepage, but I have incorrect results for ISO6937 - looks like C# is ignoring two byte chars (accent+char). I'm using this way to decode string from byte: Encoding.Convert(Encoding.GetEncoding("20269"), Encoding.UTF8, data) Example: Kraków byte[] = 4B 72 61 6B C2 6F 77 result - Krak´ow I did some research, but I find only some code from MediaPortal

Detect the encoding of a text file using C#

吃可爱长大的小学妹 提交于 2020-01-02 11:04:13
问题 I have a set of markdown files to be passed to jekyll project , need to find the encoding format of them i.e UTF-8 with BOM or UTF-8 without BOM or ANSI using a program or a API . if i pass the location of the files , the files have to be listed,read and the encoding should be produced as result . Is there any Code or API for it ? i have already tried the sr.CurrentEncoding for stream reader as mentioned in Effective way to find any file's Encoding but the result varies with the result from a

UTF-8 support issue to Java Swing? [duplicate]

喜夏-厌秋 提交于 2020-01-02 10:17:12
问题 This question already has an answer here : Closed 7 years ago . Possible Duplicate: how to implement UTF-8 format in Swing application? In Swing application I have the send button, one text area and a text field. If I press the send button, I need to send the text from text field to text area It's working fine in English But not in the local language... package package1; import java.awt.*; import java.awt.event.*; import java.io.UnsupportedEncodingException; import javax.swing.BorderFactory;

BeautifulSoup “encode(”utf-8")

穿精又带淫゛_ 提交于 2020-01-02 10:04:12
问题 from bs4 import BeautifulSoup import urllib.request link = ('https://mywebsite.org') req = urllib.request.Request(link, headers={'User-Agent': 'Mozilla/5.0'}) url = urllib.request.urlopen(req).read() soup = BeautifulSoup(url, "html.parser") body = soup.find_all('div', {"class":"wrapper"}) print(body) Hi guys, I have a problem with this code. If I run it it come the error UnicodeEncodeError: 'charmap' codec can't encode character '\u2022' in position 138: character maps to I tryed to search

Converting latin mysql data to utf8

梦想与她 提交于 2020-01-02 09:20:27
问题 I want to use utf 8 right now , but all my data is latin1 , what is the efficient way to convert data . Also I know how to change database's structure(charset) to utf8 , What I want to do is changing charset of existing data . update Here are my old setting , Html output : utf8 Html input : utf8 Php - mysql connection : latin1 mysql (fields and tables) : latin1 Here are my new settings , and I hope this is the best way to create multi-language website Html output : utf8 Html input : utf8 Php

How to use Stanford LexParser for Chinese text?

白昼怎懂夜的黑 提交于 2020-01-02 09:16:22
问题 I can't seem to get the correct input encoding for Stanford NLP's LexParser. How do I use the Stanford LexParser for Chinese text? I've done the following to download the tool: $ wget http://nlp.stanford.edu/software/stanford-parser-full-2015-04-20.zip $ unzip stanford-parser-full-2015-04-20.zip $ cd stanford-parser-full-2015-04-20/ And my input text is in UTF-8 : $ echo "应有尽有 的 丰富 选择 定 将 为 您 的 旅程 增添 无数 的 赏心 乐事 。" > input.txt $ echo "应有尽有#VV 的#DEC 丰富#JJ 选择#NN 定#VV 将#AD 为#P 您#PN 的#DEG 旅程#NN 增添