LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-27-2009, 04:25 AM   #1
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
ISO to HTML conversion - how to do automatically in a LAMP environment?


Hi Guys

I have a user who wants to update an online MySQL database I set up with an uploaded SQL script at irregular intervals.

A self-developed CMS written in PHP displays the database contents.

The problem is his SQL script contains ISO specified characters - it has several German and Swedish / French names in it, like "Luttichau" (with an umlaut on the first "u") and "Marie" (with the grave accent on the last "e")

How can I automatically encode these ISO characters to HTML in the LAMP environment?

I. e. turn "Luttichau" (umlaut "u") into "L¨ttichau" (ISO to HTML)

Presently I do this manually by taking his script and running it through an Emacs LISP script I found called "iso2html" which works just fine. Obviously though, I would prefer this to happen automatically on the server, as I'm not always around 23:15 on a Sunday night when he wants to update his data...
 
Old 05-27-2009, 04:45 AM   #2
Su-Shee
Member
 
Registered: Sep 2007
Location: Berlin
Distribution: Slackware
Posts: 510

Rep: Reputation: 53
Doesn't PHP have tons of classes and modules already doing this stuff? I know that Perl has and I simply can't imagine PHP doesn't.

If you REALLY want to do this all by yourself, grab the iso-8859-1 value of the char and wrap it into &#thevalue;. In this lower byte ranges, the iso-8859-1 value is identical to the Unicode code point - just add leading zeros.

Meaning: What is (hex) C4 in man iso-8859-1 (Ä) is 00C4 in Unicode and &#x C4; in HTML. (Spaces for visualization here - remove.)

See this handy table: http://en.wikipedia.org/wiki/List_of...ity_references

and check man iso-8859-1 and man unicode.

A simple dispatch table will also do the trick.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
what nfs performance considerations are there for lamp environment globaltree Linux - Enterprise 1 01-07-2008 01:09 PM
html to text conversion munna_dude Programming 15 10-19-2007 06:45 AM
doc to html / xml conversion in linux newbie007007 Linux - Software 5 03-04-2007 10:19 PM
HTML to XHTML conversion rjlee Linux - Software 3 01-10-2005 07:27 AM
HTML/PHP problem, using LAMP AntWarrior Programming 2 11-27-2004 08:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:04 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
Open Source Consulting | Domain Registration