-   Linux - Newbie (
-   -   Change Encoding from UTF-8 to CP1256 (

AGazzaz 12-21-2007 05:15 PM

Change Encoding from UTF-8 to CP1256
I am designing a site and as usual I filled it with lorem ipsum but when it was the time to enter the data bluefish changed the encoding from cp1256 to utf-8
I tried to change it back with kword but I got ??????? ???? which simply means that I have lost the content:(

Can I find a software that could simply change the character encoding of a file (a set of files is much better)?

rupertwh 12-21-2007 05:22 PM


man iconv
iconv will translate between just about all character sets.

AGazzaz 12-21-2007 05:33 PM

Thank you rupertwh
I tried iconv before and it did not work
here is the output this time


[ahmad@localhost n]$ iconv -f UTF-8 -t CP1256 index2.php
$page_name = "index.php";
$company_name = "iconv: illegal input sequence at position 49
[ahmad@localhost n]$

*EDIT*: sorry, I have solved the problem. bluefish changed the encoding of the page. so I lost an hour for almost nothing (if only I have noticed).

Thank you very much for your help :)

rupertwh 12-21-2007 05:51 PM


Originally Posted by AGazzaz (Post 2998389)

$company_name = "iconv: illegal input sequence at position 49

That would indicate that your file is currently not UTF-8 encoded.

Worst case would be that you somehow ended up with a file that contains a mix of different encodings.

AGazzaz 12-21-2007 05:58 PM

Actully the file was not UTF-8 at all it was CP-1256 but it was not readable by the browser because of that line that bluefish added

All times are GMT -5. The time now is 06:50 PM.