String to Windows-1251 conversion

Hi! :slight_smile:

i am trying to open a text file on a server with XML.load().The thing is, the filename is encoded in Windows-1251(cyrillic codepage) and i can’t make it open the file without converting the characters manually.Here’s the code i am using to load the file:

articleData = new XML();
articleData.onData = function(data) {
data = data.split("
“).join(”\r");
articlebox.text = data;
trace(“LOADED DATA”);

};

//articleData.load(“http://193.68.185.166/ph/blog1/a/бг.txt”); doesn’t work!!!

articleData.load(“http://193.68.185.166/ph/blog1/a/БГ.txt”); // WORKS!

Is there a way to convert the Cyrillic characters automatically to their %d version(via AS)?
Or - is there a way to save UTF-8 encoded file names in Windows?(I know how to save UTF-8-encoded content in files(via Notepad) but Windows uses Windows’s codepages(1251 and 1252) to save file’s name).

Thanks!

– edit ----

i tried to pass the string to PHP and use URLencode(…) to convert it, but still no success.URLencode returns http%d0%… and so on(i.e. doesnt even keep slashes).