Elxis CMS Forum

Support => Technical support => Topic started by: Ivan Trebješanin on May 11, 2007, 14:13:05

Title: Encoding problem (hosting)
Post by: Ivan Trebješanin on May 11, 2007, 14:13:05
Hi.

I have a rather interesting problem... http://www.bgmagazin.info
It was working flawlessly until yesterday...

This isn't Elxis fault, my opinion is that admins of hosting provider messed up something with MYSQL. As you can see, User login form, and the rest of the things that come from language files are working fine. It's just the content... I would like someone to help me with my report. What to tell them?
Title: Re: Encoding problem (hosting)
Post by: Ivan Trebješanin on May 11, 2007, 14:22:16
Sorry, I forgot to provide info on the server, so here it is: http://bgmagazin.info/locale.php

Thanx
Title: Re: Encoding problem (hosting)
Post by: datahell on May 11, 2007, 17:12:30
You should better contact your host.

If you don't find a solution there (it is his job to give you a solution), or anywhere else contact me via PM and send me data to access your mysql and your ftp.
Title: Re: Encoding problem (hosting)
Post by: Ivan Trebješanin on May 11, 2007, 17:43:41
Thanx datahell,

I wouldn't even bother with this hosting provider at all, if it was for me to decide, but my client has a relative there... I've found some SQL backup on my localhost from february, though. If they can't fix it, I'll bring that backup to DB. It isn't very active site, so I'll have to add just a few articles again.


For the Elxis users:
Stuff like this happens when your text is utf-8 encoded, but it is transfered as ISO-8859-1. I call this problem "one way utf". When you insert utf-8encoded text into DB, and that text is transfered as ISO-8859-1, you get just question marks instead of letters.

Once again, big thanx to datahell for Elxis and all the help  :D
Title: Re: Encoding problem (hosting)
Post by: Superman859 on May 21, 2007, 18:43:12
Yea this tends to happen as most hosts have the database configured for latin.  If you have control over it (which you should), switch your database to default to utf-8 first before you begin to work on the site.  If you plan on developing a site in more than one language, this works just fine.

Encodings are strange.  I actually have another site with phpBB forums.  For some reason that database defaulted to swedish or something.  I didn't know, and I had phpBB installed.  I made a small adjustment in the phpBB files so that I could use Korean text.  Later I changed servers, only to realize that the only way to get it to display all the old posts correctly was to use swedish with the new database.  So I'm using Swedish, but the text is in Korean.  I actually have no clue how it's working.  Any other encoding for the database gives display errors now.  Encodings are weird.
Title: Re: Encoding problem (hosting)
Post by: Ivan Trebješanin on May 21, 2007, 18:51:32
hehehe... you should see how database looks like when default charset is iso-8859-1 and text is cyrillic... Looks like #32745,#12312, #23434.... It would be funny if it wasn't MY site  :P
PHP6 will turn the tide hopefully.
Title: Re: Encoding problem (hosting)
Post by: datahell on May 21, 2007, 19:20:23
We have Elxis.org on php4.x/mysql4.x and goup.gr on php5.x/mysql5.x. Two very sensitive sites. Both works excellent and text is stored as clear utf8. The key inorder not to have problems with utf-8 is when you create the database and before installing Elxis to change it's encoding (default character set, default colaltion) to utf8. Then install Elxis and everything will be fine.
Title: Re: Encoding problem (hosting)
Post by: Ivan Trebješanin on May 21, 2007, 19:25:49
Yes datahell, but most hosting providers don' give you the chance to change default collation. I do everything as you described on my server, but when it comes to some "smart" guys... they don't even understand my requests.
Title: Re: Encoding problem (hosting)
Post by: datahell on May 21, 2007, 19:55:00
You don't need to change server's default collation. Just for your database, which you can do through phpmyadmin. Collation: utf8_general_ci. Of cource you must have MySQL 4.1 or newer and updated version of phpmyadmin inorder to have utf-8 encoding. . Prior to 4.1 mysql databases have problems with utf-8.
Title: Re: Encoding problem (hosting)
Post by: Ivan Trebješanin on May 21, 2007, 20:12:52
Yes, I know how to change collation trough mysql, but I'm saying that servers are configured NOT to show collation select dropdown list. Furthermore, they override it, because they think they know what you need better than you. ;)
As for myself, I have a good hosting in Holland, and they always give me what I need.

PS
I am now attempting to setup online education site with Elxis, as today I became a IT manager in that medical high school. We'll see if I can pull it off. :D