# String to Windows-1251 conversion

**URL:** <https://forum.kirupa.com/t/string-to-windows-1251-conversion/224885>\
**Category:** Uncategorized\
**Created:** [May 6, 2007, 8:15pm UTC](https://forum.kirupa.com/t/string-to-windows-1251-conversion/224885 "2007-05-06T20:15:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bLaf](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@bLaf](https://forum.kirupa.com/u/bLaf)\
**Post date:** [May 6, 2007, 8:15pm UTC](https://forum.kirupa.com/t/string-to-windows-1251-conversion/224885/1 "2007-05-06T20:15:44Z")

</div>

Hi! 🙂

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](https://articleData.load)(“[http://193.68.185.166/ph/blog1/a/&#1073;&#1075;.txt](http://193.68.185.166/ph/blog1/a/&#1073;&#1075;.txt)”); doesn’t work!!!

articleData.load(“[http://193.68.185.166/ph/blog1/a/БГ.txt](http://193.68.185.166/ph/blog1/a/%d0%91%d0%93.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).
