Jump to content


Photo

Scandinavian characters


  • Please log in to reply
7 replies to this topic

#1 nurtsio

nurtsio

    Newbie

  • Members
  • Pip
  • 4 posts
  • 0

Posted 16 August 2011 - 11:53 PM

Hi!

I've just begin using ProcessWire. Because my site is written in Finland, it contains lots of ä's (a with dots) and ö's.

The problem occurs in every field where I use these characters, it cuts the field content right there. E.g. "hyväntekeväisyys" cuts to "hyv". You see, that's a problem.

Is it the default template, UTF-8 or what?

Thank you for your assistance,
Akseli

#2 jbroussia

jbroussia

    Full Member

  • Members
  • PipPipPip
  • 70 posts
  • 10

  • LocationFrance

Posted 17 August 2011 - 02:22 AM

The default template files are ANSI encoded, maybe they should be converted to UTF8 for it to work (I have no idea !) ?

#3 adamkiss

adamkiss

    Master of the universe

  • Moderators
  • 1,078 posts
  • 289

Posted 17 August 2011 - 02:25 AM

Hi Akseli and welcome to the forums. I'm inclined to say it's utf problem – somewhere along the lines of php <=> mysql communication, since we have another scandinavian active here on the forums and in the few examples he posted, all special scandinavian characters work OK. Is your database set to UTF?

If your DB has UTF-8 set, your templates are UTF-8 (important!), you might want to try this:

In your /site/ directory, there is config.php. Locate line 137 and uncomment this:
$config->dbSetNamesUTF8 = true; 

If it doesn't help, we'll move on to different solutions :)

#4 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,517 posts
  • 842

  • LocationVihti, Finland

Posted 17 August 2011 - 06:02 AM

Moro Aleksi ja tervetuloa!

PW should be all the way UTF-8 and I have had no issues with special chars at all. Template encoding doesn't matter (only if want to write special chars directly to the template files). So agree with Adam, problem probably lies between php & mysql. Is your db tables UTF-8?

#5 ryan

ryan

    Hero Member

  • Administrators
  • 5,753 posts
  • 3102

  • LocationAtlanta, GA

Posted 17 August 2011 - 06:59 AM

It definitely sounds like a UTF8 issue. Here's another possible solution:
http://processwire.c...06.html#msg2406

I'm thinking about just placing that 'AddDefaultCharset UTF-8' to the default htaccess file so that this doesn't come up for anyone else. Though I'm not certain that's the problem here. If this solution doesn't do it, I'm guessing Akseli may be running an older 2.0 version that still had some latin1 tables in it and need to be converted to utf8.

Akseli what version are you running?

Thanks,
Ryan


#6 nurtsio

nurtsio

    Newbie

  • Members
  • Pip
  • 4 posts
  • 0

Posted 20 August 2011 - 04:26 AM

Hi, and thanks to everyone!

Ryan's link to htaccess-edit worked. Everything is working properly now! :)

I'm using the latest stable version, meaning 2.0. By the way, is 2.1 currently safe to use on production site?

#7 adamkiss

adamkiss

    Master of the universe

  • Moderators
  • 1,078 posts
  • 289

Posted 20 August 2011 - 05:40 AM

It's very close to stable, and Ryan & Antti are running sites on it for weeks (if not months already). Me however, as a quite heavy user of niche functions, found few nasty bugs (though not critical), although majority of the has been fixed. I'll be using this as a production version once my latest project goes live, that is in 5-7 days.

Use this information as you will :)

#8 ryan

ryan

    Hero Member

  • Administrators
  • 5,753 posts
  • 3102

  • LocationAtlanta, GA

Posted 21 August 2011 - 12:08 PM

If you are starting a new site I would go ahead and use 2.1. But since we're still wrapping up some details, you would just want to test any changes locally (stage them) before pushing to your production server.

However, that workflow applies regardless of version or CMS, so if you are using best practices with your workflow then use 2.1. :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users