Why does using using the emoji's like 😄 in chrome url caused the url to point to a random looking string? - google-chrome

I was basically trying to navigate to "😄.com" and found chrome to redirect to "http://xn--i28h.com/"
If you append anything before that string lets say "123😄.com" it points to http://xn--123-9h33b.com/ ie the last characters got changed!
Tried to verify this behaviour on safari and it does not changes the URL.
Can anyone help me understand what those last digits after -- could represent ?

It's called Punycode. This is how non-ascii characters in domain names are represented using ascii range.
More info: https://www.w3.org/International/articles/idn-and-iri/

Related

Can you reverse engineer Saved Query link to Application Insights?

In Analytics, if I try to Export > Share a Link to Query then a URL is copied to my clipboard.
It has the following structure:
https://analytics.applicationinsights.io/subscriptions/[subscription id]/resourcegroups/Default-ApplicationInsights-[region]/components/[resource]?q=[alphanumeric string]&apptype=web
The alphanumeric string is some sort of encoding of the actual query. Why do I say that? Because it grows or shrinks according to the size of the query. I tried seeing if it was Base64 or UUencode but neither worked. Also I tried 5 a's and 5 b's followed by 10 c's in the query (arbitrary query) to see if I would see a pattern but that didn't help either.
Some analysis with Unix tools showed that the alphanumeric string is a character set with 0-9, A-Z, +, /, and =.
Does anybody know this format so that I can make arbitrary query URLs?
Alternately being able to submit parameters to the query would solve my problem. My motivation is to link to Application Insights from my website and go to dynamic queries.
Examples of the encoded part:
Query: aaaaabbbbbbcccccccccccEncoding: ?q=H4sIAAAAAAAAA0tMBIIkMEhGAC4AHRlzExcAAAA%3D
Query: abcdefghijklmnopqrstuvwxyz0123456789
Encoding: ?q=H4sIAAAAAAAAA0tMSk5JTUvPyMzKzsnNyy8oLCouKS0rr6isMjA0MjYxNTO3sOQCANVo3%2FUlAAAA
There are 2 options to link a query.
Encoded query (works well for lengthy queries and special characters). The format is q=EncodedQuery. EncodedQuery is the query, encoded in the following way: (a) first it is compressed via gzip, and (b) then it is encoded using base64 encoding.
Plain text query. The format is query=QueryText. The downside is that the query length is (more) limited by browser's URL length limit. It may also not play well with special characters.
Hope that helps,
Yoram

ResourceLoader returns empty strings

I am trying to use a *.resw file in my UWP app to store localized strings. I am loading these strings through ResourceLoader.GetString() and am placing them in a MessageDialog for presentation to the user, but no matter what I do the return value of GetString() is an empty (zero-length) string. I am following the SDK sample for localization, but am not getting the expected response.
The string I am trying to use is of the format InvalidAssemblyDialog.Message.
As it turns out this problem was due to my using dots in the keys for my strings in the *.resw file. Dots are reserved, and my usage of them was causing name-resolution errors. In the case of the example above, I changed it to InvalidAssemblyDialog_Message.
Here the documentation says "." characters should be replaced with "/" when resources are queried from code.
If a resource name is segmented (it contains "." characters), then replace dots with forward slash ("/") characters in the resource name. Property identifiers, for example, contain dots; so you'd need to do this substition in order to load one of those from code.

Box Net: What is the pattern used and characters allowed during serach

I need to test the working of Box Net search in my application. For this I need more information about the search pattern. I see search results are compared with both file title and content.
Search is showing different behaviour when I have file names with special characters? Will search work when I have special characters as file names?
Following is the query I am using
boxSearch = client.getSearchManager().search(searchFileName, boxDefaultRequestObject);
Can you share me the pattern used during search and characters allowed and in what character combination results are seen?
Here are some resources on search:
https://support.box.com/hc/en-us/articles/200519888-How-do-I-search-for-files-and-folders-in-Box-
Box's search returns folder/file names and content, and it also accepts booleans. Just don't use mixed case (aNd is NOT okay, while AND or and is okay).
Box also accepts special characters in uploads and search. See the description here, as this was a fairly recent product update that came in mid-2013.
Additional special character support – Box will add support for more types of special characters across the Box website, desktop and mobile apps. Once the change is live, Box products will support almost all printable characters (except / \ or empty file names; also will not support leading or trailing spaces on files and folders).

How to use the DeployIt's namePattern parameter in the repository/query web-service

I’m trying to use the REST API provided by DeployIt (v3.9) to list all the packages available on a given project.
Thus, I use the GET /repository/query service
So, I’m calling this service with the following URL:
http://[server]/deployit/repository/query?namePattern=my-app&type=udm.DeploymentPackage
Unfortunately, I don’t get anything (just an empty list).
If I remove the namePattern from my URL, then I get a long list of all applications (not only the only I'm interested in).
So it appears that I don’t set correctly the namePattern attribute. In the documentation, they say:
a search pattern for the name. This is like the SQL "LIKE" pattern:
the character '%' represents any string of zero or more characters,
and the character '_' (underscore) represents any single character.
Any literal use of these two characters must be escaped with a
backslash ('\'). Consequently, any literal instance of a backslash
must also be escaped, resulting in a double backslash ('\').
So I tried the following URL:
http://[server]/deployit/repository/query?type=udm.DeploymentPackage&namePattern=my-app : empty list
http://[server]/deployit/repository/query?type=udm.DeploymentPackage&namePattern=%my-app%: error 400
http://[server]/deployit/repository/query?type=udm.DeploymentPackage&namePattern=%25my-app%25 (trying to escape the % character): empty list
http://[server]/deployit/repository/query?type=udm.DeploymentPackage&namePattern=Applications/my-app/2.0.0 (with a real version): error, character ‘/’ not allowed.
http://[server]/deployit/repository/query?type=udm.DeploymentPackage&namePattern=2.0.0 : I get the list of all applications deployed with a version 2.0.0 (including my my-app), but that's not what I'm looking for (I want all versions available on DeployIt for my-app).
So, what is the correct URL to retrieve the list of deployed applications?
I've solved my problem. In fact, the namePattern only applies to the last part of the Application name, i.e. the version.
Thus, I have to use the parent attribute to retrieve the list of my application:
http://[server]/deployit/repository/query?type=udm.DeploymentPackage&parent=Applications%2Fmy-app&resultsPerPage=-1

Rails: How to avoid changing spaces and other special characters in URLs

I'm having some trouble with characters like spaces, plus signs, double quotes and accented latin characters in rails when adding them to urls as parameters. They are always converted to numbers preceded by %, and this is generating a lot of trouble for us, since portuguese uses a lot of those characters.
Everything works just fine when typing the character manually in the URL, but once rails makes it into a link, it'll replace it.
Is there a way to avoid that?
Here's an example. Instead of
url?q=transgênico
we get
url?q=transg%C3%AAnico
This completely breaks our search and communication with other websites through parameters - which works fine when typing the special characters manually.
I must admit I did not search about this, since english is not my first language and I have no clue what to search for... All my tries had no results, but I probably was using bad terms.
Using Rails 2.3.8.
Thank you in advance.
I belive you have to encode those characters because they are not valid in a url: Uniform Resource Locators (URL) Spec and in stackoverflow
I'd try setting the :escape => false flag in link_to and the like. If that doesn't help you'll have to monkey patch actionpack/lib/action_view/helpers/url_helper.rb probably.
Maudite is right. You can convert this urls back to a 'nice' form before using it as search terms:
require 'cgi'
CGI.unescape 'url?q=transg%C3%AAnico'
produces:
"url?q=transgênico"