المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Transform non english words to a unique representation



C# Programming
06-03-2009, 05:01 PM
Hello everybody,

I need a method in c# to transform non english word to a unique string representation. The method should detect if the word contains non english characters and, only in that case it converts the word to diffrent representation, the algo is the following:


String transformString(String inputString)
{
if(inputString.containsNonEnglishChar())
{
String res = "";
foreach(char ch in inputString)
{
res += transformChar(ch);
}
return res;
}
return inputString;// return the word as is
}


I can write the method my way, but I prefer to find something standard, like base 64 or URL encoding or something famous.

Thanks in advance.

HZ