[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Html encoding

Posted on 2010-01-03
11
Medium Priority
?
337 Views
Last Modified: 2012-05-08
i need a function which convert the names for a url for all the languages for example :

I is a turkish character and when you type I to the url it returns sth. different when you press enter or another example is space it return %20

i have file sharing portal (still in devolopment process) i produce links depending on file names i need a code which generate the name for url depending on the file name which will work on all browser. I said all browsers because some of the browser does not change I char for ex. Dillo or Flock. Some of the browsers change < char to the %3E some of them %3e i need to make them clear text in one standart . is there any body knows how to do this?

0
Comment
Question by:CahitEy
  • 5
  • 4
10 Comments
 
LVL 9

Expert Comment

by:magicdlf
ID: 26168516
Is this what you want?
            string str = HttpUtility.UrlEncode(str, System.Text.Encoding.Unicode);
            string str1 = HttpUtility.UrlDecode(str, System.Text.Encoding.Unicode);
0
 
LVL 1

Author Comment

by:CahitEy
ID: 26168560
no look at this i tryed this :

A_a1 gel.mpg

and it returned me

a%5c%9a .... sth. like this i need a clear text as asagi_gel.mpg  

which convert chars to global latin chars in all languages or convert to a text which is not create sth like %c %e
0
 
LVL 3

Expert Comment

by:roeib
ID: 26169040
you can just cnovert the Text before adding it to the QueryUrl to Base64.
Base64 doesnt give a damn on the Client Languague, meaning that you will need to convert from Base64 as well ofcourse :-)

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 1

Author Comment

by:CahitEy
ID: 26169106
is there any complete list or library for this?
0
 
LVL 9

Expert Comment

by:magicdlf
ID: 26169276
So why don't you want to have UrlEncoded strings (the %3c stuff) appear in your URLs? You can always decode the string back to Turkish any time.
0
 
LVL 1

Author Comment

by:CahitEy
ID: 26169609
yes i do not want to appear sth like %3 on my url because i give this url to my visitors to visit my pages back it must be clear.
My site is also multilinaguaged site so this is not only for turkish chars
Deutch
Latin
Chinese
.....

for all the languages i need to select similar chars which is not changes the meaning of the word
for example in turkish
alamak means crying if i write aglamak it is not a problem .
i found a complete list for php

http://snipplr.com/view/11171/replace-all-latin-accents/

but this is php and i could not determine any function instead of strtr so this is harmfull

need a fast way
0
 
LVL 9

Expert Comment

by:magicdlf
ID: 26170382
0
 
LVL 1

Author Comment

by:CahitEy
ID: 26171754
The firs example is remove the non-latin chars . Second example is what i am looking for but in java :(
0
 
LVL 9

Accepted Solution

by:
magicdlf earned 2000 total points
ID: 26171810
You can either translate it into C#, or use it directly by using J# lib. For the second option, here's the tutorial:
http://www.codeproject.com/KB/cs/vmeasyzipunzip.aspx
http://msdn.microsoft.com/en-us/magazine/cc164129.aspx
Although it's for making zip files, you can learn how to use java directly in C# from  this case.
Good Luck!
0
 
LVL 1

Author Comment

by:CahitEy
ID: 26202963
I need a direct solution from c# that could make complicator sth. because it is a clustered network and very complicated structure enough. For simple thing as this i do not want to use unknown libraries ...
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question