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


  Search this Thread
Old 06-11-2007, 05:28 AM   #1
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?


EDIT: Found it out myself:
iconv --from-code=UTF-8 --to-code=ISO-8859-1 inputfile.txt > outputfile.txt
Old 06-12-2007, 05:47 AM   #2
Senior Member
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

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


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 05:44 AM
UTF-8 text file infected? kpachopoulos Linux - General 1 01-12-2006 07:37 PM
I need perlscript to convert text file in UTF-16 cccc Programming 3 07-04-2004 04:08 AM
convert CSV (TEXT) files to UTF-16 cccc Programming 1 07-01-2004 01:54 AM
Problem with UTF-8 and ISO-8859-1 dasenjo Linux - Software 0 06-22-2003 12:14 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:05 PM.

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