LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Change Encoding from UTF-8 to CP1256 (http://www.linuxquestions.org/questions/linux-newbie-8/change-encoding-from-utf-8-to-cp1256-608424/)

AGazzaz 12-21-2007 04:15 PM

Change Encoding from UTF-8 to CP1256
 
Hello,
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 04:22 PM

Code:

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

AGazzaz 12-21-2007 04:33 PM

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

Code:

[ahmad@localhost n]$ iconv -f UTF-8 -t CP1256 index2.php
<?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 04:51 PM

Quote:

Originally Posted by AGazzaz (Post 2998389)
Code:

$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 04: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 03:44 PM.