The MU forums have moved to WordPress.org

UTF-8 vs ISO-8859-1(5) (11 posts)

  1. lissyx
    Inactive
    Posted 19 years ago #

    I plan using UTF-8 on the whole blogs that i'll provide. But, there's a little problem with trackbacks : When a blog makes a trackback that didn't use UTF-8, accents are not transformed into UTF-8 on my blog, and it makes ugly stuff.

    I'm pretty sure i'm not the only one having the bug, and before starting a patch to convert non-UTF-8 trackbacks to UTF-8, i would like to know if someone already done this :)

    And if not, i'll post my code, sure.

    PS: Dunno if this kind of hack can be done using Plugins ...

  2. NetAndif
    Inactive
    Posted 19 years ago #

    i have found a great tutorial on how to create plugins:

    http://asymptomatic.net/wp/2005/04/30/1511/plugin-help/

  3. lissyx
    Inactive
    Posted 19 years ago #

    About UTF-8, i've already made a little script that direclty convert in the DB the posts from ISO-8859-1(5) to UTF-8 ... http://dev.infos-du-net.com/~lissyx/blogs/convert.phps

    Thanks for the plugin links, i've read it. I'll also look at some already done plugins, and i'll write space disk management plugin later (about 1 or 2 weeks, as i have some report to do before ... and some exams too !)

  4. NetAndif
    Inactive
    Posted 19 years ago #

    Thx Lissyx!
    I appreciate your work...

  5. lissyx
    Inactive
    Posted 19 years ago #

    About plugins, i've started space management plugin. But starting it, i realized that as plugin could be disabled, then it's not a good idea to make a plugin for space _limitation_, isn't it ?

    And about UTF-8, do you know how i can intercept trackback requests (to the blog, and from the blog) ?

  6. NetAndif
    Inactive
    Posted 19 years ago #

    Yes you're right, not a good idea to make it a plugin.
    But if you have an admin interface, it could be just included in menu.php, with a little check for the main blog:
    if (get_settings('blogname') == wpmu_adminOption_get('blogname')
    menu[.....
    Of course, you would have another check in the file itself.

    About the trackback issue, i think this would not be easy, as you must 'guess' the charset of the source trackback.
    If you knew it, you could utf8_encode() it, for example.

  7. lissyx
    Inactive
    Posted 19 years ago #

    I was aware of this, but with making direct HTTP request to test the charset it should be possible, shouldn't it ?

    I know, it's a bit ugly :)

  8. NetAndif
    Inactive
    Posted 19 years ago #

    Maybe. Do you actually have some clue how this http request would look like?
    I somehow don't believe it could be done using php...

  9. lissyx
    Inactive
    Posted 19 years ago #

    I was thinking using Sockets :)

    But it could be done with PEAR classes I think. By the way, I first need to find out how to intercepts trackbacks !
    As using mbstring it could be possible to identify charset, afaik ...

    http://fr2.php.net/manual/en/ref.mbstring.php

    Hem, it seems like there's already some code within wp-trackback.php !

    if ( function_exists('mb_convert_encoding') ) { // For international trackbacks
    $title = mb_convert_encoding($title, get_settings('blog_charset'), $charset);
    $excerpt = mb_convert_encoding($excerpt, get_settings('blog_charset'), $charset);
    $blog_name = mb_convert_encoding($blog_name, get_settings('blog_charset'), $charset);
    }

  10. miquelon
    Member
    Posted 17 years ago #

    Here is a solution we worked out by duplicating a plugin, renaming some of the functions. We were then able to pull RSS from ISO and UTF websites.

    http://www.websiteforensics.com/?p=1#more-1

  11. theapparatus
    Member
    Posted 17 years ago #


About this Topic

  • Started 2026 years ago by lissyx
  • Latest reply from theapparatus