Forums

Swedish letters in template (20 posts)

  1. johanlundin88
    Member
    Posted 4 years ago #

    I can’t write Swedish letters (å,ä,ö) in the default template. It works to write the letters in a post, but I have to use the letters in the template files and I can’t use letter codes (because I can’t change the text).

    Is there a way to make this possible?

  2. moshu
    Member
    Posted 4 years ago #

    What do you mean you cannot change the text?
    Just open the file on your computer in a plain text editor (like Notepad) and make ALL the changes you want.
    Then click "Save As" and make sure in the dialog box you select the proper encoding = utf-8.
    It should work.

  3. johanlundin88
    Member
    Posted 4 years ago #

    I can't change the texts because I don't have access to the them, they are picked out from a database with a script in the template file.

  4. moshu
    Member
    Posted 4 years ago #

    Which theme? What text? Link?

  5. johanlundin88
    Member
    Posted 4 years ago #

    I have customized the default theme. http://various.vegetarian.at/

  6. moshu
    Member
    Posted 4 years ago #

    they are picked out from a database with a script in the template file

    You mean you are "re-posting" RSS feeds from other sites... or what?

    In that case the original site and your site MUST have the same character encoding.

  7. johanlundin88
    Member
    Posted 4 years ago #

    Actually the database with the texts is on my own server, but other people write the texts and that’s why I can’t in a simple way change the letters.

    Other sites on my server do have Swedish character encoding, but not this WordPress template. I can’t understand why it doesn’t and how I can change it.

  8. moshu
    Member
    Posted 4 years ago #

    but other people write the texts
    How? THAT matters... if the input to that database is not happening with utf-8 - it will never work.

    Do your other sites have the same input thing by others?

  9. johanlundin88
    Member
    Posted 4 years ago #

    The script works at my other sites on the same server. I can pick out the same texts from the same database.

  10. johanlundin88
    Member
    Posted 4 years ago #

    I think it's something with my database being set to ISO-8859-1 and WordPress UTF-8. The text from the databse works if I change to ISO-8859-1 in Firefox.

    How do I change my database table to UTF-8?

  11. moshu
    Member
    Posted 4 years ago #

    How do I change my database table to UTF-8?

    That's not that simple: it would mess up a lot of things; e.g. then it would display wrong characters on ALL the other sites where it is OK now...

  12. johanlundin88
    Member
    Posted 4 years ago #

    Ok, but let's try.

  13. johanlundin88
    Member
    Posted 4 years ago #

    All WordPress tables and rows are set to latin1_swedish_ci (same as the tables to this script) what’s the difference between the tables? Or is it something I should change in the script to make it work with UTF-8?

  14. moshu
    Member
    Posted 4 years ago #

    That's why I didn't want you to mess with the database. Encoding and collation are two different things and you have to understand very well how they work before doing anything.
    There were some posts about changing the encoding - it's a long and painful process. Try to search for it!

    Sorry, I am not an expert in this matter, so I don't feel comfortable giving advice that might destroy your site :(

  15. johanlundin88
    Member
    Posted 4 years ago #

    I don't get why it should be a long process to change the character encoding in one table with Phpmyadmin, and I couldn’t find anything about how to do it.

    I tried this in SQL, but it didn’t seam to work:
    ALTER TABLE kopochsalj DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci

    Does anyone else know how to do this?

  16. moshu
    Member
    Posted 4 years ago #

    http://codex.wordpress.org/Converting_Database_Character_Sets

    MAKE BACKUPS before touching anything!

  17. sgtpetter
    Member
    Posted 4 years ago #

    Hi!
    Modify wp-config.php in line 7 to 'latin1' instead of 'utf8'.

    Had the same problem in Norwegian. Worked for me.

  18. moshu
    Member
    Posted 4 years ago #

    If it is an upgrade you should DELETE those two lines with charset and collation!

  19. johanlundin88
    Member
    Posted 4 years ago #

    I still can't get it to work. I couldnt find anything about charset and collation in wp_config.php.

    I want to change my script, the tables of the script to UTF8. Not my WordPress blog.

  20. johanlundin88
    Member
    Posted 4 years ago #

    I know what’s wrong. The page where you insert the texts to the database have to be UTF8 to, that’s why it didn’t work!

    Thanks for al help, I think I can make it work now.

Topic Closed

This topic has been closed to new replies.

About this Topic