Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Problem with charset after changing servers
My host had changed servers and suddenly all my non standard characters in my posts were converted to junk, characters such as “š, đ, ž, č, ć”. I can’t begin to even wonder how, because in the database everything is fine (says my host), but he said that I have some posts with htmlentities, and some with utf-8 text—my guess is that something has changed when I upgraded to 4.0.2. He says the problem is with php somehow, and that the database is clean and ok.
here is my diagnose:
<pre>Textpattern version: 4.0.2 (r1076)
last_update: 2005-11-14 22:41:04/2005-12-20 11:37:10
Document root: /home/virtual/site30/fst/var/www/html
$path_to_site: /home/virtual/site30/fst/var/www/html
Textpattern path: /home/virtual/site30/fst/var/www/html/textpattern
Permanent link mode: section_title
Temp folder: /tmp
Site URL: dnevnikeklektika.com
PHP version: 5.1.1
Register globals: 1
server_time: 2006-01-28 20:42:31
MySQL: 4.1.12-log
Locale: en_GB.UTF-8
Server: Apache/2.0.52 (CentOS)
Apache version: Apache/2.0.52 (CentOS)
.htaccess file contents:
————————————
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#RewriteBase /relative/web/path/
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L]
RewriteRule ^(.*) index.php </IfModule>#php_value register_globals 0
————————————
Charset (default/config): latin1/utf8
character_set_client: utf8
character_set_connection: utf8
character_set_database: latin1
character_set_results: utf8
character_set_server: latin1
character_set_system: utf8
character_sets_dir: /usr/share/mysql/charsets/
18 Tables: de_textpattern is latin1, de_txp_category is latin1, de_txp_css is latin1, de_txp_discuss is latin1, de_txp_discuss_ipban is latin1, de_txp_discuss_nonce is latin1, de_txp_file is latin1, de_txp_form is latin1, de_txp_image is latin1, de_txp_lang is latin1, de_txp_link is latin1, de_txp_log is latin1, de_txp_page is latin1, de_txp_plugin is latin1, de_txp_prefs is latin1, de_txp_priv is latin1, de_txp_section is latin1, de_txp_users is latin1
PHP extensions: libxml, xml, wddx, tokenizer/0.1, sysvshm, sysvsem, sysvmsg, standard/5.1.1, SimpleXML, sockets, SPL, shmop, session, pspell, posix, PDO, pdo_sqlite/1.0, mime_magic/0.1, iconv, gmp, gettext, ftp, exif/1.4 $Id: exif.c,v 1.173.2.2 2005/10/10 06:09:25 helly Exp $, date/5.1.1, curl, ctype, calendar, bz2, zlib/1.1, pcre, openssl, apache2handler, dom/20031129, gd, imap, ldap, mbstring, mysql/1.0, pgsql, snmp, soap, xmlrpc/0.51, xsl/0.1, Zend Optimizer
Apache modules: core, prefork, http_core, mod_so, mod_access, mod_auth, mod_auth_anon, mod_auth_dbm, mod_auth_digest, util_ldap, mod_auth_ldap, mod_include, mod_log_config, mod_env, mod_mime_magic, mod_cern_meta, mod_expires, mod_deflate, mod_headers, mod_usertrack, mod_setenvif, mod_mime, mod_dav, mod_status, mod_autoindex, mod_asis, mod_info, mod_dav_fs, mod_vhost_alias, mod_negotiation, mod_dir, mod_imap, mod_actions, mod_speling, mod_userdir, mod_alias, mod_rewrite, mod_proxy, proxy_ftp, proxy_http, proxy_connect, mod_cache, mod_suexec, mod_disk_cache, mod_file_cache, mod_mem_cache, mod_cgi, httpd_defines20, httpdmon, mod_perl, mod_php5, mod_python, mod_ssl, mod_jk, mod_fpcgid
/include/txp_category.php: r901 (ced49a43561099e1652fccb7880b8f66)
/include/txp_plugin.php: r902 (20ba701396c318619a4e00681af8b228)
/include/txp_auth.php: r928 (4cfa9ec7960f80308c9392cec5722616)
/include/txp_form.php: r947 (c0e4393328985742bd81cda61d10d5ed)
/include/txp_section.php: r904 (3575f34afd7bf1400ecb7926483fcbd2)
/include/txp_tag.php: r982 (c4f3b1cd5aa07a45f6218ec2a6befe0f)
/include/txp_list.php: r1042 (e85d2de1c63b41f0e5bdcf268e3c487b)
/include/txp_page.php: r876 (e22dc37b465b87757722732a225b25f3)
/include/txp_discuss.php: r1056 (1e6c25bf973a445a9e6ff710064f01f9)
/include/txp_prefs.php: r1026 (6c0696f2147c45276380a7438dbd1575)
/include/txp_log.php: r906 (68c4f32b70ce41a349f197b6bba6c200)
/include/txp_preview.php: r628 (a16f84b6610fc66db0bce51e25b7af34)
/include/txp_image.php: r1042 (d9c8518ac976a9f21af59c9012818546)
/include/txp_article.php: r1049 (7dfdffb58a90570e8ad90debc1017b0c)
/include/txp_css.php: r922 (0c596d9968052b89581d1ca65a77c5de)
/include/txp_admin.php: r1074 (7e87ff0e29101593fb170b1a2de9fd59)
/include/txp_link.php: r1042 (f4e99d4b37e5c80f3c9fb2f1b1c08e3d)
/include/txp_diag.php: r1075 (d4b97f820b0ea9abe593cb74bf3891c2)
/lib/admin_config.php: r877 (9aea12193cc76eea1964eb0383ec6513)
/lib/txplib_misc.php: r1064 (c4b8079db64c3fbe57ea961181d88512)
/lib/taglib.php: r628 (493878f922262157601c26a999a1c478)
/lib/txplib_head.php: r1055 (a8e03ea3e927ddde5fc25434a506dfb7)
/lib/classTextile.php: r1072 (52c3c2efdde23f52efdd0d7728c6986f)
/lib/txplib_html.php: r1002 (e8f4c2552170d92d5d353dae725c8bba)
/lib/txplib_db.php: r1064 (7dc8e32e097645d4340de2f809896521)
/lib/IXRClass.php: r765 (2efb0fb05b55c634072b0bae9af38bdd)
/lib/txplib_forms.php: r950 (74da2c67abe4786c353ea416c13656eb)
/publish/taghandlers.php: r1067 (1e9624108bdd485003629ae239619414)
/publish/atom.php: r1037 (30aea53e1c1fce877a10d2d9fa3ce90c)
/publish/log.php: r864 (c3d16d3dfe375819a19fcd62398e4b86)
/publish/comment.php: r1057 (7db181efda097083988e47eb00960915)
/publish/search.php: r884 (80f942f1dc301857c2fa9dcb16aa1246)
/publish/rss.php: r1037 (6848c34e120c99b6889b7f19c421b076)
/publish.php: r1073 (700374ed1a9cb57b5afc355ac977daad)
/index.php: r1076 (482a2e752575c2b7b620a86520b99303)
/css.php: r944 (df1c754417bdfb4e97a2c83ae5b454ee)
</pre>
Can anyone give me the answer to how this could have happened? In my config.php I have stated that my DB charset is utf-8, which it in reality is, how come all my non standard characters are turning to junk?
URI is http://dnevnikeklektika.com
PS
when you comment it doesn’t accept utf-8 text, but in my mail i get the comment OK, with all characters in perfect order. Sorry if I sound stupid, I’m a desinger, not a programmer, I know nothing about this stuff… :(
EDIT:
when I put charset as latin1 through config.php it shows the characters OK, but the document is not unicode then.
Last edited by Dragan (2006-01-28 23:40:47)
Offline
Re: Problem with charset after changing servers
First, it’s hard to troubleshoot, if it’s not exactly clear what has changed, and how things were before. THere are several different situations in which things “work”, and it’s not clear how thins used to work for you.
Here is some background and information on how to read Diagnostics output:
http://textpattern.net/wiki/index.php?title=Unicode_Support#Diagnostics
First: Don’t make any changes in the admin-side, don’t save any articles, forms etc. Everything you change now, that things are misconfigured may leave permanent damage (in the form of permantently broken articles with “funny” characters).
18 Tables: de_textpattern is latin1, de_txp_category is latin1, de_txp_css is latin1, de_txp_discuss is latin1, de_txp_discuss_ipban is latin1, de_txp_discuss_nonce is latin1, de_txp_file is latin1, de_txp_form is latin1, de_txp_image is latin1, de_txp_lang is latin1, de_txp_link is latin1, de_txp_log is latin1, de_txp_page is latin1, de_txp_plugin is latin1, de_txp_prefs is latin1, de_txp_priv is latin1, de_txp_section is latin1, de_txp_users is latin1
The charset that is configured in config.php does not match the charset of the tables. One of the two possibly changed. The eaiest thing woul be to try to change the value in config.php and see if older articles look ok. (Articles that you saved after the problems appeared will probably continue to look broken).
If that does not help, my suggestion would be to investigate how things were configured exactly previously on your install (check backups of your files and db-backups for example), and ask your host what the exact changes were that they did.
(On a sidenote: In the past textile would use named/numeric html-entities for utf-8 characters, but that was dropped, since it wasn’t necessary. It also has nothing to do with your problem.)
Offline
Re: Problem with charset after changing servers
OK, now I have changed it back to utf in config.php (and edited one post) and everything mysteriously works again.
Last edited by Dragan (2006-01-28 23:49:45)
Offline