url-encoding

URL decoding Japanese characters etc. in Java

微笑、不失礼 提交于 2019-12-13 15:00:56
问题 I have a servlet that receives some POST data. Because this data is x-www-form-urlencoded, a string such as サボテン would be encoded to サボテン. How would I unencode this string back to the correct characters? I have tried using URLDecoder.decode("encoded string", "UTF-8"); but it doesn't make a difference. The reason I would like to unencode them, is because, before I display this data on a webpage, I escape & to & and at the moment, it is escaping the &s in the encoded string so the characters

Url Encoding in AngularJS front end with Spring REST backend

时光总嘲笑我的痴心妄想 提交于 2019-12-13 06:14:37
问题 quick question. I have an AngularJS front end communicating with a Spring REST backend . URL encoding is only necessary for encoding parameters passed in the url (for application/x-www-form-urlencoded). I don't have to worry about the encoding in the body, correct ? 回答1: For content type of application/x-www-form-urlencoded the body of a post message needs to be uri encoded: $http({ url: myUrl, method: 'POST', data: $httpParamSerializerJQLike(myData), headers: { 'Content-Type': 'application/x

URL Encoding being lost before processing - ASP.net

拜拜、爱过 提交于 2019-12-13 01:16:53
问题 I am building a web-store that uses URL encoding extensively. I have a list of Departments & Categories in my database which I use to generate the links. These are, of course, URL encoded before they are sent. Some Typical Links are... /MySite/Store/Countertop+Equipment/Can+Openers.aspx /MySite/Store/Dinnerware.aspx /MySite/Store/Kitchen/Pastry%2f+Decorating.aspx In my HTTPHandler I call app.Request.Path to obtain the current path. The string returned by this call is no longer URL encoded

Bad URL encoding for images

故事扮演 提交于 2019-12-13 00:38:35
问题 In my app, there is an ImageView that display an image from a URL. I download the image using this method: Bitmap bitmap=null; URL imageUrl = new URL(url); HttpURLConnection conn = (HttpURLConnection)imageUrl.openConnection(); conn.setConnectTimeout(30000); conn.setReadTimeout(30000); conn.setInstanceFollowRedirects(true); InputStream is=conn.getInputStream(); OutputStream os = new FileOutputStream(f); Utils.CopyStream(is, os); os.close(); bitmap = decodeFile(f); return bitmap; This works

Should a browser encode a custom URI before launching an app?

情到浓时终转凉″ 提交于 2019-12-12 18:34:11
问题 I have an app which gets launched on a custom URI which looks like myapp://whatever/something There is a HTML page which has a href link as this -> myapp://whatever/?x=abc;y=pqr; When this is clicked in chrome, myapp gets the URL myapp://whatever/?x=abc%3By%3Dpqr%3B , the URL gets encoded However when I click on the same link on the default Internet browser - no encoding is done. It gets the original URL -> myapp://whatever/?x=abc;y=pqr; What is the correct behavior? I tried this using Chrome

Unable to decode Base-64 URLs

时光毁灭记忆、已成空白 提交于 2019-12-12 17:24:56
问题 I have an application that builds an HTML email. Included in the content is an encoded URL parameter that might, for example, contain a promotional code or product reference. The email is generated by a Windows service (essentially a console application) and the link, when clicked is handled by an MVC web site. Here is the code for creating the email link: string CreateLink(string domain, string code) { // code == "xyz123" string encrypted = DES3Crypto.Encrypt(code); // H3uKbdyzrUo= string

Apache RewriteRule redirection with url encoded

萝らか妹 提交于 2019-12-12 17:22:59
问题 I have this URL (urlencoded twice): http%253A%252F%252Fwww.google.cl%252F%2523test (translated: http://www.google.cl/#test) And this Rewrite Rule: RewriteRule /linkto/(.*?)/ ${unesc:$1} [R,L] If i put this url in the browser: http://localhost/linkto/http%253A%252F%252Fwww.google.cl%252F%2523test/data/ Apache redirects to http://www.google.cl/%23test instead of http://www.google.cl/#test The problem ocurrs only with # (number sign). Any ideas? 回答1: Can you try NE flag: RewriteRule ^/?linkto/(.

Best way to encode URL in Java

旧巷老猫 提交于 2019-12-12 10:16:14
问题 HI guys, I have a URL and I want to embed it in the body of a mailto . Till now, I've tried 2 methods to encode the URL and both of them did not give me good results: URLEncoder - this gave me plus signs in the e-mail message since apparently URLEncoder is appropriate for query parameters only. org.apache.commons.httpclient.URI - this doesn't give me the complete URL. It gives me the same results as I had explained in a post earlier here: Escape & symbol in MailTo What can I do? Thanks :) Krt

NSCharacterSet URLHostAllowedCharacterSet doesn't replace '+' sign?

和自甴很熟 提交于 2019-12-12 07:46:14
问题 I'm struggling to transmit long encrypted strings over the network and get them to come out correctly on the server. For example, I have this encrypted string on the client: wcWSERZCh8Xm1hpbNo1kSD1LvFmpuUr4wmq9hQUWeK0vYcLeFPGwFR/sBTES1A4rPV6eyp9nzEEU9uKkiFSTdP+SPOSqUf6evjf3WRHrXMRe81lIrHuRyk0iRwoNe5uIk+VlpR41kETmznXa4+gELmf53r7oayRkkffnIPDmpO+WbgE0VL3PQeOsXB01tWJyDiBIsz5WJiiEIm3ZoJW/sw== As you can see, it has a few characters that will not transmit over the network without some URL encoding

System(s) for encoding data using a limited set of characters

扶醉桌前 提交于 2019-12-12 05:08:11
问题 up-front clarification of exactly what I need: I would like to know - are there any standards or conventions for encoding information like this within a url that I might try to use to read what it says ? I'm sure there are established methods for encoding binary information using non-binary character sets. In this case each location can be occupied by one of 66 different characters, so each "byte" is slightly longer than six bits if you look at it logarithmically. For example, a link in a