LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-21-2007, 04:15 PM   #1
AGazzaz
Member
 
Registered: Nov 2005
Location: Egypt
Distribution: Fedora 17 KDE
Posts: 393

Rep: Reputation: 31
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)?
 
Old 12-21-2007, 04:22 PM   #2
rupertwh
Member
 
Registered: Sep 2006
Location: Munich, Germany
Distribution: Debian / Ubuntu
Posts: 298

Rep: Reputation: 49
Code:
man iconv
iconv will translate between just about all character sets.
 
Old 12-21-2007, 04:33 PM   #3
AGazzaz
Member
 
Registered: Nov 2005
Location: Egypt
Distribution: Fedora 17 KDE
Posts: 393

Original Poster
Rep: Reputation: 31
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

Last edited by AGazzaz; 12-21-2007 at 04:44 PM.
 
Old 12-21-2007, 04:51 PM   #4
rupertwh
Member
 
Registered: Sep 2006
Location: Munich, Germany
Distribution: Debian / Ubuntu
Posts: 298

Rep: Reputation: 49
Quote:
Originally Posted by AGazzaz View Post
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.
 
Old 12-21-2007, 04:58 PM   #5
AGazzaz
Member
 
Registered: Nov 2005
Location: Egypt
Distribution: Fedora 17 KDE
Posts: 393

Original Poster
Rep: Reputation: 31
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make konsole/terminal and emacs to recognize UTF-8 encoding? chandru.in Linux - Software 3 12-05-2007 10:40 AM
Re: Locale problem: Can't convert string from native encoding to 'UTF-8' treotan Ubuntu 1 11-14-2007 08:02 AM
why my system default support BIG5?how to change UTF-8? singying304 Linux - General 1 07-24-2006 07:57 PM
determine encoding type of a file (ie - UTF-8) chovy Linux - Software 1 04-03-2006 12:46 AM
[Enter] in text documents diffrent on Windows and Linux? UTF-8/UTF-16 problem or? brynjarh Linux - General 1 11-24-2004 05:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration