Page 2 of 2 First 12
  • Jump to page:
    #16
  1. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,749
    Rep Power
    9397
    Thought so. Something is decoding and thinking the result is UTF-8 (it's probably ISO 8859-1/Latin1), and it gets displayed using question marks (because the Latin1 stuff isn't valid UTF-8 stuff).

    That decoding is somewhere. It doesn't look like it's the database so far...
    When the Python script goes to get data and display it, immediately before the SELECT do a
    Code:
    SET NAMES utf8
    query. Does that change anything?
  2. #17
  3. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,270
    Rep Power
    12
    Yes it does!

    i entered manully greek stuff into the fdatabase via phomyadmin
    and when i executed set names utf8 before the retriveing then i no longer see ???? but instead i see proper greek letters!

    But when i enter greek letters trrough my php script they no longer appear correctly when retrieved neither in phpmyadmin as well.
    What is now proved was once only imagined!
  4. #18
  5. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,749
    Rep Power
    9397
    So it is the database.

    With your Python try adding a charset=utf8 to the constructor (instead of a SET NAMES).
    Code:
    con = MySQLdb.connect( db = 'nikos_pelatologio', host = 'localhost', user = 'nikos_nikos', passwd = '*******', charset = 'utf8' )
    How does the PHP script connect?
  6. #19
  7. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,270
    Rep Power
    12
    whta you gave me produce errors, but the following does work properly!

    Code:
    con = MySQLdb.connect( db = 'nikos_pelatologio', host = 'localhost', user = 'nikos_nikos', passwd = '******', init_command='SET NAMES UTF8' )
    What is now proved was once only imagined!
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo