Results 1 to 8 of 8

Thread: Replace unicode by HTML code

  1. #1
    Join Date
    Oct 2004
    Location
    Posts
    10

    Default Replace unicode by HTML code

    Hello,

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

  2. #2
    Join Date
    Mar 2004
    Location
    Posts
    312

    Default Re: Replace unicode by HTML code

    What's your OCD default character set? [View | Preferences | Database (tab) | Languages (section)]

    I have absolutely no problems with the special Nordic characters

  3. #3
    Join Date
    Oct 2004
    Location
    Posts
    10

    Default Re: Replace unicode by HTML code

    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:
    [url]http://avelde.mine.nu[/url]

    Auke

  4. #4
    Join Date
    Mar 2004
    Location
    Posts
    312

    Default Re: Replace unicode by HTML code

    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 <!--[GroupField]-->?? ??<!--[/GroupField]--> to a javascript function which then would replace special characters with their HTML entities.

    This could be the first part of the operation:

    <!--[Group($browsefld1)]-->
    <!--[GroupPageLink]-->
    <script language="javascript">
    <!--
    var name = "<!--[GroupField]-->?? ??<!--[/GroupField]-->"
    convertName(name);
    //-->
    </script>
    <!--[/GroupPageLink]-->
    <!--[/Group]-->

    Then comes the second part, the javascript function:

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

  5. #5
    Join Date
    Oct 2004
    Location
    Posts
    10

    Default Re: Replace unicode by HTML code

    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

  6. #6
    Join Date
    Mar 2004
    Location
    Posts
    312

    Default Re: Replace unicode by HTML code

    Hmm, PHP and mySQL - sounds interesting. Good luck!

  7. #7
    Join Date
    Oct 2004
    Location
    Posts
    10

    Default Re: Replace unicode by HTML code

    I'm ready with the PHP and MySQL in CMI style. Now I can start with my own style.
    [url]http://avelde.mine.nu/music/music.php[/url]

  8. #8
    Join Date
    Mar 2004
    Location
    Posts
    312

    Default Re: Replace unicode by HTML code

    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.)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •