LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 05: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, 05:47 AM   #2
veerain
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.
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:44 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