encoding

powershell character encoding from System.Net.WebClient

青春壹個敷衍的年華 提交于 2020-01-13 10:22:09
问题 I am running the following command: ([xml](new-object net.webclient).DownloadString( "http://blogs.msdn.com/powershell/rss.aspx" )).rss.channel.item | format-table title,link The output for one of the RSS items contains this weird text: You Don’t Have to Be An Administrator to Run Remote PowerShell Commands So, the question is: Why the mix up in characters? What happened to the apostrophe? Why is the output rendered as Don’t when it should just render as Don't ? How would I get the

powershell character encoding from System.Net.WebClient

随声附和 提交于 2020-01-13 10:22:08
问题 I am running the following command: ([xml](new-object net.webclient).DownloadString( "http://blogs.msdn.com/powershell/rss.aspx" )).rss.channel.item | format-table title,link The output for one of the RSS items contains this weird text: You Don’t Have to Be An Administrator to Run Remote PowerShell Commands So, the question is: Why the mix up in characters? What happened to the apostrophe? Why is the output rendered as Don’t when it should just render as Don't ? How would I get the

How to get correctly-encoded HTML from the clipboard?

自闭症网瘾萝莉.ら 提交于 2020-01-13 09:36:09
问题 Has anyone noticed that if you retrieve HTML from the clipboard, it gets the encoding wrong and injects weird characters? For example, executing a command like this: string s = (string) Clipboard.GetData(DataFormats.Html) Results in stuff like: <FONT size=-2>Â Â <A href="/advanced_search?hl=en">Advanced Search</A><BR>Â Â <A href="/preferences?hl=en">Preferences</A><BR>Â Â <A href="/language_tools?hl=en">Language Tools</A></FONT> Not sure how MarkDown will process this, but there are weird

Converting to Base64 in JavaScript without Deprecated 'Escape' call

蓝咒 提交于 2020-01-13 09:26:09
问题 My name is Festus. I need to convert strings to and from Base64 in a browser via JavaScript. The topic is covered quite well on this site and on Mozilla, and the suggested solution seems to be along these lines: function toBase64(str) { return window.btoa(unescape(encodeURIComponent(str))); } function fromBase64(str) { return decodeURIComponent(escape(window.atob(str))); } I did a bit more research and found out that escape() and unescape() are deprecated and should no longer be used. With

Problems with PHP Mailer header encoding

帅比萌擦擦* 提交于 2020-01-13 09:22:05
问题 <?php require_once('../class.phpmailer.php'); //include("../class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded iconv_set_encoding("internal_encoding", "UTF-8"); $mail = new PHPMailer(); $mail->CharSet = "utf8"; /* $body = file_get_contents('contents.html'); $body = eregi_replace("[\]",'',$body); */ $mail->IsSMTP(); // telling the class to use SMTP //$mail->Host = "mail.app-cpr.com"; // SMTP server //$mail->SMTPDebug = 2; // enables SMTP debug

Problems with PHP Mailer header encoding

╄→尐↘猪︶ㄣ 提交于 2020-01-13 09:21:27
问题 <?php require_once('../class.phpmailer.php'); //include("../class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded iconv_set_encoding("internal_encoding", "UTF-8"); $mail = new PHPMailer(); $mail->CharSet = "utf8"; /* $body = file_get_contents('contents.html'); $body = eregi_replace("[\]",'',$body); */ $mail->IsSMTP(); // telling the class to use SMTP //$mail->Host = "mail.app-cpr.com"; // SMTP server //$mail->SMTPDebug = 2; // enables SMTP debug

What's “ANSI_X3.4-1968” encoding?

心已入冬 提交于 2020-01-13 07:51:46
问题 See following output on my system: [STEP 101] # python3 -c 'import sys; print(sys.stdout.encoding)' ANSI_X3.4-1968 [STEP 102] # [STEP 103] # locale LANG=C LANGUAGE=en_US:en LC_CTYPE="C" LC_NUMERIC="C" LC_TIME="C" LC_COLLATE="C" LC_MONETARY="C" LC_MESSAGES="C" LC_PAPER="C" LC_NAME="C" LC_ADDRESS="C" LC_TELEPHONE="C" LC_MEASUREMENT="C" LC_IDENTIFICATION="C" LC_ALL=C [STEP 104] # Googled but found very little info about it. Even Python's The Python Library Reference (v3.5.2) does not mention it.

speex decoding going wrong

送分小仙女□ 提交于 2020-01-13 05:54:50
问题 I'm using speex to encode some audio data and send it over UDP, and decode it on the other side. I ran a few tests with speex, and noticed that if I decode a packet straight after I encoded it, the decoded data is in no way close to the original data. Most of the bytes at the start of the buffer are 0. So when I decode the audio sent over UDP, all I get is noise. This is how I am encoding the audio: bool AudioEncoder::encode( float *raw, char *encoded_bits ) { for ( size_t i = 0; i < 256; i++

SmarterCSV and file encoding issues in Ruby

时光毁灭记忆、已成空白 提交于 2020-01-13 05:28:11
问题 I'm working with a file that appears to have UTF-16LE encoding. If I run File.read(file, :encoding => 'utf-16le') the first line of the file is: "<U+FEFF>=\"25/09/2013\"\t18:39:17\t=\"Unknown\"\t=\"+15168608203\"\t\"Message.\"\r\n If I read the file using something like csv_text = File.read(file, :encoding => 'utf-16le') I get an error stating ASCII incompatible encoding needs binmode (ArgumentError) If I switch the encoding in the above to csv_text = File.read(file, :encoding => 'utf-8') I

binary encoding for JSON?

那年仲夏 提交于 2020-01-13 04:48:31
问题 My Javascript application is downloading quite a bit of data from the server and I was thinking that in addition to normal gzip that's done by the server, I can encode the data in some binary format rather than textual JSON. Is there a standard way of doing this? Ideally it should be some small tool that can take a JSON text file and convert it to a generic binary format and a small Javascript library which decodes it. Also, is there something special that needs to be done in XHR to pass