PDA

View Full Version : Replace unicode by HTML code



avelde
10-16-2004, 10:11 AM
Hello,

When I export to HTML it all goes well, except the names with special unicode characters, such as

pheisholt
10-18-2004, 08:37 AM
What's your OCD default character set? [View | Preferences | Database (tab) | Languages (section)]

I have absolutely no problems with the special Nordic characters

avelde
10-19-2004, 02:11 PM
I've no problem on my Windows server when hosting the website. But hosting the site on my Linux server the special characters aren't translated correctly. The exported web pages contain the correct characters, but I like to translate it to the HTML code.

I'm trying to program the solution in PHP, but it is easier when the CMI export works properly.

btw, the character set is Western Europe.

Take a look at the site at:
http://avelde.mine.nu

Auke

pheisholt
10-20-2004, 02:14 PM
I see what you mean. It doesn't look good.

You could modify the CMI template, and make it pass the name to be converted to a javascript conversion routine.

For instance on the start page you could pass <!---->?? ??<!----> to a javascript function which then would replace special characters with their HTML entities.

This could be the first part of the operation:

<!---->
<!---->
<script language="javascript">
<!--
var name = "<!---->?? ??<!---->"
convertName(name);
//-->
</script>
<!---->
<!---->

Then comes the second part, the javascript function:

<script language="javascript">
<!--
function convertName(name)
{
name = name.replace(/

avelde
10-22-2004, 05:13 PM
Thanks Paul.

It did work, and for now it is sufficient. I want to translate the complete site to something in php and mysql, but it takes a while because of the time.

So thanks,

Auke

pheisholt
10-25-2004, 06:15 PM
Hmm, PHP and mySQL - sounds interesting. Good luck!

avelde
11-01-2004, 07:49 AM
I'm ready with the PHP and MySQL in CMI style. Now I can start with my own style.
http://avelde.mine.nu/music/music.php

pheisholt
11-01-2004, 04:49 PM
Congratulations! It looks great.

I have no experience with PHP, but I understand it has some neat features. (Among others a function to access the file system, which does not trigger all kinds of security alerts and pop-up messages.)