XMB Forum Software
Not logged in [Login - Register]
Go To Bottom

Printable Version  
 Pages:  1  
Author:

[Resolved] Critical error: Usage of norwegian special characters (, , ) blanks the post.

solbu
Member
***




Posts: 33
Registered: 1-10-2007
Location: Norway
Member Is Offline

Mood: No Mood

exclamation.gif posted on 8-5-2013 at 10:53 PM
[Resolved] Critical error: Usage of norwegian special characters (, , ) blanks the post.


Full Board URL: http://forum.solbu.net/
XMB Version: 1.9.11

I run a norwegian forum. Whenever someone posts anything containing the norwegian special characters , and , the entire post is totally BLANK both on preview and when posting.

The apache logs give no errors.

Anyone have any idea as to what is going on?
(The forum is running on Debian 7)




My posts are licensed under a Creative Commons license
View user's profile Visit user's homepage View All Posts By User
lottos
Administrator
********




Posts: 362
Registered: 6-3-2002
Location: Competitions Australia: https://www.lottos.com.au/
Member Is Offline

Mood: pass me a TimTam

[*] posted on 8-6-2013 at 12:10 AM


Which character set are you using on the database - see http://forums.xmbforum2.com/viewthread.php?tid=776873

Has this just started to occur?
Was there an upgrade to mysql or php on your server?




Largest list of competitions online!
View user's profile Visit user's homepage View All Posts By User
eman86
Member
***




Posts: 62
Registered: 6-4-2013
Member Is Offline

Mood: Excited

[*] posted on 8-6-2013 at 12:20 PM


I think if the tables were set to UTF-8 it might resolve that issue for you.



Next Gen of XMB in the workings...
View user's profile View All Posts By User
solbu
Member
***




Posts: 33
Registered: 1-10-2007
Location: Norway
Member Is Offline

Mood: No Mood

[*] posted on 8-7-2013 at 08:10 AM


Quote: Originally posted by lottos  
Which character set are you using on the database - see http://forums.xmbforum2.com/viewthread.php?tid=776873
It seems to be latin1_swedish_ci.

Quote:
Has this just started to occur?
Was there an upgrade to mysql or php on your server?
It happened sometimes this summer. I don't know exactly when, as the forum is not a wery active one, and I don't use it each week myself.
But we did upgrade from Debian 6 to Debian 7 this summer, so there most definetly was an upgrade of both MySQL and php.

Quote: Originally posted by eman86  
I think if the tables were set to UTF-8 it might resolve that issue for you.
Interesting. And how do we do that? :)



My posts are licensed under a Creative Commons license
View user's profile Visit user's homepage View All Posts By User
eman86
Member
***




Posts: 62
Registered: 6-4-2013
Member Is Offline

Mood: Excited

[*] posted on 8-7-2013 at 01:03 PM


you have go and change that manually on each xmb table. give some some time and I can write up a nifty script for you :)



Next Gen of XMB in the workings...
View user's profile View All Posts By User
solbu
Member
***




Posts: 33
Registered: 1-10-2007
Location: Norway
Member Is Offline

Mood: No Mood

[*] posted on 8-8-2013 at 07:27 AM


Quote: Originally posted by eman86  
you have go and change that manually on each xmb table. give some some time and I can write up a nifty script for you :)
Hmm. I found something that did that, and the special characters still blanks the posts. And changing it somehow broke every configured setting throughout the entire forum. Like Sub forum names, the rules, etc.. So we had to revert all changes by importing from backup.



My posts are licensed under a Creative Commons license
View user's profile Visit user's homepage View All Posts By User
lottos
Administrator
********




Posts: 362
Registered: 6-3-2002
Location: Competitions Australia: https://www.lottos.com.au/
Member Is Offline

Mood: pass me a TimTam

[*] posted on 8-8-2013 at 09:05 AM


Quote: Originally posted by solbu  

It happened sometimes this summer. I don't know exactly when, as the forum is not a wery active one, and I don't use it each week myself.
But we did upgrade from Debian 6 to Debian 7 this summer, so there most definetly was an upgrade of both MySQL and php.


Perhaps you can find out what versions you were running and what versions you upgraded to.




Largest list of competitions online!
View user's profile Visit user's homepage View All Posts By User
Mouser
XMB Contributor
********


Avatar


Posts: 198
Registered: 4-14-2008
Member Is Offline

Mood: Christmasy. Yes, in September.

[*] posted on 8-8-2013 at 03:35 PM


Always good to make a back-up if you do changes like that.

However, changing the charset should not break all configured settings.

Could you please show us a screenshot of what you changed?
View user's profile View All Posts By User
solbu
Member
***




Posts: 33
Registered: 1-10-2007
Location: Norway
Member Is Offline

Mood: No Mood

[*] posted on 8-16-2013 at 04:32 PM


First, sorry for late response.

Quote: Originally posted by Mouser  
Always good to make a back-up if you do changes like that.
No problems there. We have an automated (crontab) daily database backup routine that keep backups for 5 months back.
Quote:
Could you please show us a screenshot of what you changed?
We reverted to the old nonworking backup, so all is the same as it where when the operating system was upgraded, so I don't have a screenshot. I also remember the php script I used (and ran in the terminal) had problems converting some of the tables and exited, resulting in me having to run all of the steps manually anyway, and stil had some tables that would not convert, so I can't use it again.

Any other ideas?




My posts are licensed under a Creative Commons license
View user's profile Visit user's homepage View All Posts By User
solbu
Member
***




Posts: 33
Registered: 1-10-2007
Location: Norway
Member Is Offline

Mood: No Mood

[*] posted on 8-16-2013 at 04:32 PM


Quote: Originally posted by eman86  
you have go and change that manually on each xmb table. give some some time and I can write up a nifty script for you :)
I think I'll have take you up on the offer. :)



My posts are licensed under a Creative Commons license
View user's profile Visit user's homepage View All Posts By User
eman86
Member
***




Posts: 62
Registered: 6-4-2013
Member Is Offline

Mood: Excited

[*] posted on 8-16-2013 at 08:29 PM


I'll try to whip something up this weekend and will post back when I'm done :)



Next Gen of XMB in the workings...
View user's profile View All Posts By User
eman86
Member
***




Posts: 62
Registered: 6-4-2013
Member Is Offline

Mood: Excited

[*] posted on 8-21-2013 at 12:50 AM


here it is, this will convert every xmb table to UTF-8

Attachment: xmb-sql-utf8.php (3kB)
This file has been downloaded 372 times





Next Gen of XMB in the workings...
View user's profile View All Posts By User
Adalberto
Member
***




Posts: 13
Registered: 5-19-2013
Location: MyHome
Member Is Offline


[*] posted on 8-21-2013 at 11:47 AM


Quote: Originally posted by eman86  
here it is, this will convert every xmb table to UTF-8

Thanks ;)
View user's profile View All Posts By User
Mouser
XMB Contributor
********


Avatar


Posts: 198
Registered: 4-14-2008
Member Is Offline

Mood: Christmasy. Yes, in September.

[*] posted on 8-21-2013 at 08:31 PM


On my forum, the charset is "latin1_swedish_ci" and have not had any issues so far. *crosses fingers*


The provided PHP file, works if the table_prefix is "xmb_".
Q; Why not include the config.php and pull the database info and table_prefix from there? ;)




7 Years ago I made some handy scripts for versions like XMB1.9.6.
I've taken one of those files and modified the queries to be run.
This will work without the need to modify it, just upload it to the forum-root and run it... Then click on the link to start the procedure to update your tables to charset "utf8_unicode_ci".


Please, create a backup of your database before you start this procedure !!

Attachment: TablesEncoding.php (5kB)
This file has been downloaded 216 times

View user's profile View All Posts By User
eman86
Member
***




Posts: 62
Registered: 6-4-2013
Member Is Offline

Mood: Excited

[*] posted on 8-22-2013 at 12:14 PM


I was going to do that mouser but since XMB's codebase is a bit new to me I wasn't sure if the config had anything sort of "anti-theif" check to it. 99.99% of people don't change the prefix imo at from my experience most don't do it unless theres a real reason to.



Next Gen of XMB in the workings...
View user's profile View All Posts By User
Adalberto
Member
***




Posts: 13
Registered: 5-19-2013
Location: MyHome
Member Is Offline


[*] posted on 8-22-2013 at 07:50 PM


Hi, problem in my forum is when one member write message with this chars:


If I use php 5.3 or lower work correctly, but I see blank window with php 5.4 or higher. Only solution is change charset with utf8_unicode_ci :)
View user's profile View All Posts By User
solbu
Member
***




Posts: 33
Registered: 1-10-2007
Location: Norway
Member Is Offline

Mood: No Mood

[*] posted on 9-8-2013 at 06:45 AM


I've now tested both scripts, and nothing changes. As in, the error of blank posts still remains.



My posts are licensed under a Creative Commons license
View user's profile Visit user's homepage View All Posts By User
lottos
Administrator
********




Posts: 362
Registered: 6-3-2002
Location: Competitions Australia: https://www.lottos.com.au/
Member Is Offline

Mood: pass me a TimTam

[*] posted on 9-8-2013 at 08:35 AM


Seems to be a known issue with php 5.4:

http://stackoverflow.com/questions/15028339/odd-issue-with-f...


This implies reloading the data into the database fixed it:

http://stackoverflow.com/questions/14049079/php-5-4-9-mysql-...


vbulletin also had issues:

http://www.vbulletin.com/forum/forum/vbulletin-4/vbulletin-4...

with this the possible fix, if implemented into xmb:

http://www.vbulletin.com/forum/forum/vbulletin-4/vbulletin-4...

http://www.vbulletin.com/forum/forum/vbulletin-4/vbulletin-4...


Along with SMF, with this their possible fix:

http://www.simplemachines.org/community/index.php?topic=4971...


and Wordpress:

http://core.trac.wordpress.org/ticket/24121


Another possible workaround is step 4 from

http://xaviesteve.com/1223/issues-with-accents-and-strange-c...



I suspect the culprits are the post.php file:

$rawsubject = htmlspecialchars_decode($threadname, ENT_QUOTES);
$rawusername = htmlspecialchars_decode($username, ENT_QUOTES);
$rawemail = htmlspecialchars_decode($subs['email'], ENT_QUOTES);
$rawbbname = htmlspecialchars_decode($bbname, ENT_NOQUOTES);

Example:
$rawusername = htmlspecialchars_decode($username, ENT_QUOTES);
probably needs change to:
$rawusername = htmlspecialchars_decode($username, ENT_QUOTES, 'utf8');

In functions.inc.php,
function htmlspecialchars_decode($string, $type=ENT_QUOTES)
probably also needs changing.

If that works, there are another six instances in u2u.inc.php, possibly others in other script files.


Although... probably best to have the settings or config.php have the character set type rather than hard code.




Largest list of competitions online!
View user's profile Visit user's homepage View All Posts By User
solbu
Member
***




Posts: 33
Registered: 1-10-2007
Location: Norway
Member Is Offline

Mood: No Mood

[*] posted on 9-8-2013 at 11:45 AM


Quote: Originally posted by lottos  
probably best to have the settings or config.php have the character set type rather than hard code.
Then the question becomes, how do one do that. :)



My posts are licensed under a Creative Commons license
View user's profile Visit user's homepage View All Posts By User
Daniel Gouveia
XMB International Support
*********


Avatar


Posts: 64
Registered: 4-10-2007
Location: Portugal, Braga
Member Is Offline

Mood: |Catch Me If You Can|

[*] posted on 9-9-2013 at 02:49 AM


I'm a bit far from the xmb but I'll try to help.

The problem is the php 5.4 like lottos said.

Maybe this can fix this problem but is not a permanent solution

Just replace the file validate.inc.php

Attachment: validate.inc.php (14kB)
This file has been downloaded 350 times






You Never Walk Alone
View user's profile View All Posts By User
 Pages:  1  

  Go To Top

Powered by XMB 1.9.11 (Debug Mode)
Forum Script Software by XMB © 2001-2020 The XMB Group
[Queries: 16] [PHP: 31.9% - SQL: 68.1%]
Funded with thanks to competitions website.