ASP.NET - URL having multilingual characters - Asked By Naresh Kumar on 05-Oct-10 04:34 AM

Hi All,

I am having fileName with multilingual characters and also with english characters, uploading a file to some location its working fine. During uploading I am creating a HTMLAnchor and assigning the path to href , if it is normal filename with english charactes able to open that link but if the file name contains multilingual characters unable to open the link.
Here is the sample code I am using,
Example fileName : 会社コード( 1079)ーTKT-906711-LBNBL4.txt,

HtmlAnchor hlF = new HtmlAnchor();

hlF.HRef = "http://localhost/Pages/Sample.txt" // abel to open this file
hlF.HRef = "http://localhost/Pages/会社コード( 1079)ーTKT-906711-LBNBL4.txt" // not able to open, I am not getting any link for this for the Anchor.

Please help me in this, bit urgent.

Thanks in advance

Vasanthakumar D replied to Naresh Kumar on 05-Oct-10 04:48 AM

try to enode the URL using URLEncode.

while creating HTML anchor, encode it using Server.URLEncode method

Naresh Kumar replied to Vasanthakumar D on 05-Oct-10 05:18 AM
Thanks its working fine...