url-encoding

Getting U+fffd/65533 instead of special character from Query String

自古美人都是妖i 提交于 2019-12-09 01:49:12
问题 I have a C# .net web project that have a globalization tag set to: <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="nb-no" uiCulture="no"/> When this URL a Flash application (you get the same problem when you enter the URL manually in a browser): c_product_search.aspx?search=kjøkken (alternatively: c_product_search-aspx?search=kj%F8kken Both return the following character codes: k U+006b 107 j U+006a 106 � U+fffd 65533 k U+006b 107 k U+006b 107 e U+0065 101 n U+006e

Encode file path properly using python

孤者浪人 提交于 2019-12-08 16:23:58
问题 I am trying to open files by getting the path from a dictionary. Some of the file names have commas (,) and other such characters which when used give a "no such file found error" For instance the following file path will not open: foo,%20bar.mp3 If characters like commas exist then it should be encoded as : foo%2C%20bar.mp3 Can anyone tell me how to do this? 回答1: You may need pathname2url Python 2.x (docs) >>> from urllib import pathname2url >>> pathname2url('foo, bar.mp3') 'foo%2C%20bar.mp3

Spring Cloud Zuul Reverse Proxy doesnt fetch data from CouchDB when URL encoded

依然范特西╮ 提交于 2019-12-08 03:30:54
问题 (UPDTED) I created a Spring cloud Reverse proxy using spring-cloud-starter-zuul to forward all pouchDB-CouchDB requests through my proxy. and it forward all requests that are like http://10.16.33.221:8080/couchdb/** . Here is my application.properties file zuul.routes.couchdb.url=http://10.16.32.85:5984/ ribbon.eureka.enabled=false server.port=8080 10.16.32.85:5984 is CouchDB address. The problem occurred when pouchDB - CouchDB sync requests are forwarding. I found some URL-encoded Options

Why does Google not support valid URLs with & in query string?

筅森魡賤 提交于 2019-12-08 02:14:56
问题 Trying to validate the following HTML with the W3C validator will throw 3 errors (as of 2013-10-30): <!DOCTYPE html> <head><title>asdf</title></head> <img src="http://maps.googleapis.com/maps/api/staticmap?zoom=13&size=279x183&markers=50.916780,5.347420&sensor=false" alt="map"> The 3 errors are all the same: & did not start a character reference. (& probably should have been escaped as &.) Unfortunately, conforming to the W3C here will lead to the static maps image not being rendered. Try to

How can I know if url-encoded string is UTF-8 or Latin-1 with PHP?

非 Y 不嫁゛ 提交于 2019-12-08 01:57:49
问题 I am getting data from various site through url. Url parameters are url-encoded with the php urlencode() function, but character encoding can be still be UTF-8 or Latin-1. For example, the é character, when url-encoded from UTF-8 becomes %C3%A9 but when url-encoded from Latin-1, it becomes %E9. When I get data through url, I use urldecode() and then I need to know what is the character encoding so I eventually use utf8_encode before I insert them in a MySQL database. Strangely, the following

ASP.Net URL Encoding

爱⌒轻易说出口 提交于 2019-12-07 01:40:38
问题 I am implementing URL rewriting in ASP.net and my URLs are causing me a world of problems. The URL is generated from a database of departments & categories. I want employees to be able to add items to the database with whatever special characters are appropriate without it breaking the site. I am encoding the data before I construct the URLs. There are several problems... IIS decodes the URL before it reaches .net making it impossible to properly parse anything with a "/" in it. ASP.net gets

jQuery's $.ajax URL Encoding Problems

旧街凉风 提交于 2019-12-06 17:12:16
问题 I'm using jQuery's $.ajax method to send and retrieve data to a REST service. Some of the URL's I'm providing to the $.ajax method requires spaces and other special characters to be encoded. The problem lies with Chrome, Safari (Webkit) and Internet Explorer browsers. Firefox POST's to a URL which is encoded but the other browsers POST to a URL which isn't encoded. As an example: $.ajax ({ url: "http://localhost:8080/rest/123/Product Line A/[Product Type B]", type: "POST", dataType: "json",

C# Start a new MailTo Process and HTML URL Encoding

此生再无相见时 提交于 2019-12-06 16:13:47
问题 I have created a new MailTo extension method for the Process class which just fills the Process with a new ProcessStartinfo which contains the required mailto arguments. I have created a method called FormatMailToArgument (Right at the end) which converts control characters to their Url Encoded equivelants and have tested this and it works but is there a better way of doing this? /// <summary> /// <see cref="Process"/> extension methods. /// </summary> public static class Processes { #region

How can I know if url-encoded string is UTF-8 or Latin-1 with PHP?

荒凉一梦 提交于 2019-12-06 10:14:05
I am getting data from various site through url. Url parameters are url-encoded with the php urlencode() function, but character encoding can be still be UTF-8 or Latin-1. For example, the é character, when url-encoded from UTF-8 becomes %C3%A9 but when url-encoded from Latin-1, it becomes %E9. When I get data through url, I use urldecode() and then I need to know what is the character encoding so I eventually use utf8_encode before I insert them in a MySQL database. Strangely, the following code doesn't work : $x1 = 'Cl%C3%A9ment'; $x2 = 'Cl%E9ment'; echo mb_detect_encoding(urldecode($x1)).'

How can I disable URL-encoding of cookies in Rails

一笑奈何 提交于 2019-12-06 07:34:57
I have a Rails application that has to co-exist with a very old legacy application. The legacy application looks for a cookie that has a value containing a specific string of characters. Unfortunately, the characters in the legacy cookie often contain slashes. The problem I have is that when the Rails application writes the cookie it first does URL-encoding which causes the legacy app to break because the cookie values is incorrect. I had this working in Rails 1.13.5 by editing the file cookie_performance_fix.rb (Path: ./actionpack-1.13.5/lib/action_controller/cgi_ext/cookie_performance_fix.rb