Jump to content

How to change dbCHARSET?


disall2000
 Share

Recommended Posts

I'm in need of changing the charset for my site but I couldn't find any way of doing so since changing $config->dbCharset = 'utf8'; in wire/config.php gave me an error when I tried to install. I couldn't find anyway of changing charset during the installation configuration either. So how do I do it? I need it to be set to Swedish language so that I can sort letter like Å,Ä and Ö proper.

Link to comment
Share on other sites

Sort order isn't really part of the character set, it's decided by the accompanying collation. Currently, PW doesn't set this explicitly, which means it defaults to the default setting of the database (as far as that is applicable to the individual table's character set). Changing the charset to a single-byte one is not advisable nowadays, but you shouldn't need to anyway.

Simply set your database's collation to utf8_swedish_ci before you install PW.

ALTER DATABASE whateveryounamedit
CHARACTER SET utf8
COLLATE utf8_swedish_ci;

After that, any newly created tables with utf8 charset follow the Swedish sorting and substitution rules.

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...