SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Member
    Join Date
    Jan 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    scandinavian letters

    Hi! Im creating a flash movie using mysql database. Im using php to get values from database. My problem is that the values contains scandinavian letters and in flash movie they are replaced with squares. I don't think that the problem is in flash movie because the movie can read utf-8 -coded text properly. So I think i should find a way to print the MIME-coded string for flash movie in utf8 format?

    Thanks!

  2. #2
    SitePoint Addict evertcollab's Avatar
    Join Date
    Apr 2006
    Posts
    241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    assuming the characters are already in your database as UTF-8 data..

    PHP Code:
    <?php
      header
    ('Content-type: text/html; charset=utf-8');
    ?>

  3. #3
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It might be the font, that hasn't got the characters.
    Otherwise - how do you get the data from php to flash ?

  4. #4
    SitePoint Wizard REMIYA's Avatar
    Join Date
    May 2005
    Posts
    1,351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Encode the characters to their unicode codes

  5. #5
    SitePoint Member
    Join Date
    Jan 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Header -code didnt work. I suppose the database is utf-8 -coded. Anyway I havent found a way to make it sure using phpmyadmin.

    Php-code itself prints text as "&variable1=value1&variable2=value2......". And thats the form which Flas movie can read.

    Thanks for comments!

  6. #6
    SitePoint Wizard REMIYA's Avatar
    Join Date
    May 2005
    Posts
    1,351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You'd better use XML files for any Unicode language packs.

  7. #7
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should use rawurlencode on the variable when outputting them in an url.

    Mysql defaults to a swedish iso-8859 variant if you don't explicitly set the charset top something else.

  8. #8
    SitePoint Wizard REMIYA's Avatar
    Join Date
    May 2005
    Posts
    1,351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Charset doesn't always work right.

  9. #9
    SitePoint Addict evertcollab's Avatar
    Join Date
    Apr 2006
    Posts
    241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    remiya.. charset (in mysql called collation) should work perfectly.. in what cases are you running into problems?

  10. #10
    SitePoint Wizard REMIYA's Avatar
    Join Date
    May 2005
    Posts
    1,351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Should work perfectly. However, it must also work perfectly with all language inputs, that is what Unicode is about.
    Isn't it better to save it in a language inspecific format

  11. #11
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Collation is something different (yet related). The charset is a way of storing characters in the ascii 128+ range. The collation is how to sort characters in the ascii 128+ range. In some languages may come before while in other languages it's the other way around. (Dunno if this is an actual case, but it might just be).

    Either way, it's irrelevant to the actual problem at hand. The poster just needs to url-encode data sent over the uri-string.

  12. #12
    PHP Brainiac dg_den_golotyuk's Avatar
    Join Date
    Jul 2006
    Location
    Kiev, Ukraine
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If there is such need, why not to use XML, as REMIYA adviced. XML works perfectly with any chars (couse of using UTF-8) and Flash has good API for working with XML data. Try
    DG [Den Golotyuk], Lead Developer
    Chestnut Software
    Avoid web outsourcing scams!
    Click here
    for a free downloadable report


Bookmarks

Posting Permissions

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