LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 06-11-2007, 06:28 AM   #1
@ngelot
Member
 
Registered: Oct 2004
Posts: 84

Rep: Reputation: 15
convert text-file from utf-8 to iso-8859-1 [SOLVED]


I've got an sh-script running on my server to fetch newsheadlines from the web using wget and sed.

The output are produced as an UTF-8 file, and my apache is iso-8859-1. This means all special-chars (like in norwegian) are displayed wrong when the output-file are displayed on my webpage (with <? include('outputfile.txt'); ?>).

How can I force output to iso-8859-1? Either with a commandtool or php?

Thanks!


EDIT: Found it out myself:
Code:
iconv --from-code=UTF-8 --to-code=ISO-8859-1 inputfile.txt > outputfile.txt
 
Old 06-12-2007, 06:47 AM   #2
veerain
Member
 
Registered: Mar 2005
Posts: 359

Rep: Reputation: 38
You can use libiconv also
it has more number of conversions.
 
1 members found this post helpful.
  


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
im getting UTF-8 to STRING: Could not open converter from 'UTF-8' to 'ISO-8859-1' jabka Linux - Newbie 2 11-24-2006 06:44 AM
UTF-8 text file infected? kpachopoulos Linux - General 1 01-12-2006 08:37 PM
I need perlscript to convert text file in UTF-16 cccc Programming 3 07-04-2004 05:08 AM
convert CSV (TEXT) files to UTF-16 cccc Programming 1 07-01-2004 02:54 AM
Problem with UTF-8 and ISO-8859-1 dasenjo Linux - Software 0 06-22-2003 01:14 AM


All times are GMT -5. The time now is 02:27 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration