I am implementing an arabic site in which I want the url to be generated in arabic Fro eg:-program/يه تشامبيونز ليغ - مباشر
I have implemented the same for english in angularjs and ruby.SO the url is generating for english language
On click event I am calling a filter and the filter is helping me to deal with special characters.
The following is the code I have implemented in the filter:-
woi.filter('encodeUrl',['$routeParams','$rootScope',function($routeParams,$rootScope){
return function(value){
if(value != undefined)
{
return value.replace(/\$\#\*\!/g, 'CeNc').replace(/\"/g, 'DqO').replace(/\+/g, 'PLus').replace(/\[/g, 'ObR').replace(/\]/g, 'CbR').replace(/\@/g, 'AtR').replace(/\&/g, 'EmPe').replace(/\#/g, 'HaSh').replace(/\*/g, 'StAr').replace(/\$/g, "DoLr").replace(/\-/g, "~").replace(/\s/g, "-").replace(/\//g, "$").replace(/\?/g, '*').replace(/\%/g, 'PeRc');
}
else
{
return ""
}
}
}]);
But when I am trying to implement for arabic url it is giving me a strange output:-
For eg for programs I am getting-
www.example.com/#!/program/%D8%A8%D9%8A%D8%BA-%D8%A8%D9%88%D8%B3
So what should I do to generate the output ie url in arabic.Is there anything I can do to implement it in the filter