encoding

Why can't my web page apply its CSS?

故事扮演 提交于 2019-12-25 01:32:32
问题 I have a simple website(primarily static html/css) but for some reason some of the pages won't apply the external css in Firefox (works in IE). http://bjmarine.net/services.html - Is broken http://bjmarine.net/index.html - Works fine I have compared both files and can't see any difference. I have tried them in editplus and notepad. When I view the broken page with firebug and fresh I start to see some chinese characters all over the place. Not sure how to fix this, or how it happended. I'm

difference between python and node base64 decoding

末鹿安然 提交于 2019-12-25 01:32:05
问题 I am puzzled at this base64 decoding issue, and it seems that python and node.js does this differently. Node does this correctly I believe. Could anyone help point out why python does not work here? Thank you. Node > console.log(Buffer.from('Im3Osc6_z4HPgc-J==', 'base64').toString()); "mαορρω Python >>> from base64 import decodestring >>> print decodestring('Im3Osc6_z4HPgc-J==') "mαγ?s?p 回答1: What you provided is actually not a standard base64, but a URL-safe base64 which substitutes -

How to avoid & in XML ?

馋奶兔 提交于 2019-12-25 01:24:05
问题 I am trying to send all data to xml through php. But somehow XML parses the data and in Password it finds & and replaces it with & after that data is posted through Curl. So is there any method / technique to avoid & in xml. Or it goes as it is. I am tried almost all encoding functions. 回答1: Use the CDATA Section to make it leave the ampersand unchanged. 回答2: In the normal course of events, & in the data is encoded as & in the XML, and the XML parser decodes this and presents it as & to the

why do I need mb_convert_encoding to show the correct characters

梦想的初衷 提交于 2019-12-25 00:42:50
问题 my website have charset=UTF-8, and mysql DATABASE is also set to be UTF-8 encoding. my problem is that when I retrieve text from mysql to the website, i need to use php function mb_convert_encoding(@db_field,'utf-8','iso-8859-1') to show the text properly. it looks like that system think mysql DB is in iso-8859-1. 回答1: Run this right after you connect to the database: mysqli_query("SET NAMES utf8"); /* or mysql_query */ It is not enough to set the collation of the table to UTF-8, you also

Getting file path with umlauts from command line arguments under win7 using a batch file

只愿长相守 提交于 2019-12-25 00:37:53
问题 I am using a batch file to run a python script with command line arguments. (Yes I know python could do this on its own but I want to understand why this is not working) One argument is a file path with umlauts (ä, ü, ö). If I use the windows console and write the path with the keyboard everything works fine. If I try to use a batch file (run_script.bat) and test it with os.path.exists(filepath) it fails. I read a lot about encode and decode stuff but still no solution. Example: I wrote

To encode vb script [closed]

左心房为你撑大大i 提交于 2019-12-24 22:36:15
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . How to encode vb script so that others cant see the code inside 回答1: Look at http://www.microsoft.com/technet/scriptcenter/resources/qanda/mar06/hey0309.mspx 回答2: The other posters have (sensibly) pointed you in

Server.UrlEncode apostrophe(') in Firefox

雨燕双飞 提交于 2019-12-24 21:39:33
问题 So I have a Hyperlink called lnkTwitter: And I'm trying to set the url in the code behind: lnkTwitter.NavigateUrl = string.Format("http://www.twitter.com/home?status={0}", Server.UrlEncode("I'm Steven")); When I do that and hover over the link, the url displays correctly in the status bar as "http://www.twitter.com/home?status=I'm+Steven", but the actual url, if I click on the link or look at the link's properties, is "http://www.twitter.com/home?status=I%27m+Steven". For some reason, this

Coverting unicode codeepoint format

北战南征 提交于 2019-12-24 21:10:46
问题 Let's say that I have a character string containing bytes representing an emoji: string <- "This is a test. U+1F600" How can I transform it into string <- "This is a test. \U0001F600" So that I can render it as utf8_print("This is a test \U0001F600") [1] "This is a test 😀​" 回答1: This is kind of a hack, but it works for your case: string <- c("This is a test. U+1F600", "Another test") # change U+XXXXYYYY to \UXXXXYYYY, quote and encode special characters expr <- gsub("U[+]([0-9A-Fa-f]{1,8})",

convert serialport.readline() non-ascii string into a byte array

╄→尐↘猪︶ㄣ 提交于 2019-12-24 20:36:57
问题 I want to use serialport.readline() because it's a blocking call and the data I'm getting has 0x0D 0x0A (CR LF) at the end. However, what I want is an Hex String instead of an Ascii representation. For example, the device I am communication with is sending byte arrays like {0xff,0xff,0x45,0x0D,0x0A}. I want to simply print out in my program just like this: 0xff, 0xff,0x45. Readline() kindly trims out LF and CR. I though about using serialport.read(buff[]...) by specifying how many bytes I

Convert inline specified UTF-8 mail subject to UTF-8 text

南楼画角 提交于 2019-12-24 20:18:17
问题 I want to convert the following raw mail subject to normal UTF-8 text: =?UTF-8?B?UmU6ICMyLUZpbmFsIEFjY2VwdGFuY2UgdGVzdCB3aXRoIG5ldyB0ZXh0IHdpdGggU2xvdg==?= =?UTF-8?B?YWsgaW50ZXJwdW5jdGlvbnMgIivEvsWhxI3FpcW+w73DocOtw6khxYgi?= The real text for that is (yes, there are some crazy diacritics in it): Re: #2-Final Acceptance test with new text with Slovak interpunctions "+ľščťžýáíé!ň" The way I handle mail subjects: function subject_imapUtf8($str){ $conv = ''; $subParts = preg_split('/[\r\n]+/',