Multibyte characters in URL are not rendering - character-encoding

I have a bugging problem. For a website I made there are search engine friendly URL's generated. The only problem is there are ß-chars in the url too. Chars like ö, ï, ä, ü etc. are placed correct. But with the ß-char there is a diamond-icon with a questionmark in it. -> �
I thought it had to do with the charset which is used but i've tried both UTF-8 and iso-8859-1. Both without luck.
I need to have the correct character in the url for the readability of deeplinks.

does the character U+00DF in UTF8 work with you?
i tried to use it on Firefox and the URL was translated into ss
in URL encoding, the U+00DF should be translated to %DF

Thanks for your answers, both + 1. I've solved the problem by using the iconv function, which is installed by default.

Related

whmcs charset & template

I have one problem with charset, I need UTF-8 and ISO-8859-1.
I tried there to set up it:
(whmcs language )
but it is not working.
I tied this:
But it still show at homepage this:
Client area is working.
I just need this at homepage Ä Ö Ü ß *
I hope someone can help.
thanks
Did you try it without ISO-8859-1? After removing it you may need to re-type the strings again. UTF-8 should work, we use it with Arabic and it is perfect.
Check database and tables, they should be UTF-8 as well, and there are tools to convert tables to UTF-8. check this script:
https://gist.github.com/wesamly/2c994e6bd4466151b60b
Note: Backup your database before converting.

How to fix encoding issues ? (NSString / XMLParsing)

I parsed an XML file containing UTF8/latin characters (é, â, è, î, etc...).
At first I tried to fix this with a function replacing the wrong chars. But I'm having a problem with à, replaced by ".
And as I don't want to replace all the " of my file, I have to find another way to fix it.
Any idea to fix this ?
Thanks a lot for your advices
To finally answer this question, it worked using TBXML. But only with UTF-8 encoding, not ISO-8859-1.

Problem with cyrillic characters in Ruby on Rails

In my rails app I work a lot with cyrillic characters. Thats no problem, I store them in the db, I can display it in html.
But I have a problem exporting them in a plain txt file. A string like "элиас" gets "—ç–ª–∏–∞—Å" if I let rails put in in a txt file and download it. Whats wrong here? What has to be done?
Regards,
Elias
Obviously, there's a problem with your encoding. Make sure you text is in Unicode before writing it to the text file. You may use something like this:
ic = Iconv.new('UTF-8//IGNORE', 'UTF-8')
your_unicode_text = ic.iconv(your_text + ' ')[0..-2]
Also, double check that your database encoding is UTF-8. Cyrillic characters can display fine in DB and in html with non-unicode encoding, e.g. KOI8-RU, but you're guaranteed to have problems with them elsewhere.

How do I show non-standard characters in the address bar?

I have a bugging problem. For a website I made there are search engine friendly URL's generated. The only problem is there are ß-chars in the url too. Chars like ö, ï, ä, ü etc. are placed correct. But with the ß-char there is a diamond-icon with a questionmark in it.
I thought it had to do with the charset which is used but i've tried both UTF-8 and iso-8859-1. Both without luck.
I need to have the correct character in the url for the readability of deeplinks.
Solved the problem with iconv function.

Properly url encode space character

I use HttpUtility.UrlEncode to encode any value that is used in a route.
I already solved an issue with encoding forward slashes. The new problem I have now is with spaces. A space is encoded as + .
This works on the VS integrated Webserver, but I have an issue with it in IIS7 on Windows Server 2008.
If I have the URL http://localhost/Home/About/asdas+sdasd
I get the error 404.11 - Request contains double escape sequence.
I know I can just replace the space by "%20", but I dont want to care about propper encoding myself. Is there any ready to use UrlEncoder for MVC out there?
' ' encoded to %20 use HttpUtility.UrlPathEncode.
Any URL Encoding is most often designed to work on the path component of the url, the reason because different schemes have different characters in the safe list. Look for your libraries urlencoder and just use it in the path and above portion of the url.
#HttpUtility.UrlPathEncode(path)
UrlPathEncode just encodes the path of the Url, rather than encoding the whole Url.

Resources