Support Forums

Cannot use ��� in usernames

This is a discussion on Cannot use ��� in usernames within the Technical Support forums, part of the Technical Support Forums category; Running 4.1.8 Designer version Using deepsea template Hello, I posted this as a bug, but I�m not sure if it ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

Reply
 
Thread Tools Display Modes
Old 01-08-2010, 04:51 PM   #1
Member
 
Join Date: Dec 2009
Posts: 53
Rep Power: 4
jonten123 is on a distinguished road
Default Cannot use ��� in usernames

Running 4.1.8 Designer version

Using deepsea template


Hello,

I posted this as a bug, but I�m not sure if it is a bug so I�ll ask you guys as well. I cannot register a username that contains �, � or �. I get the message that only letters and characters are allowed. I have changed all class_user... tables and the class_registration table to utf8_swedish_ci. I have also opened the templates/default/user/userjoin.tpl in a text editor and saved it with the UTF8 encoding. I know nothing about coding but I added this line as well to the userjoin.tpl file <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> but nothing helps. This is something I need to fix before I go online with the script. I want companies to register with their company names as their usernames and many of them has �, � or � in their name.

Thanks!

Last edited by jonten123; 01-08-2010 at 05:04 PM.
jonten123 is offline   Reply With Quote
Old 01-08-2010, 05:55 PM   #2
Moderator
 
juven14's Avatar
 
Join Date: Mar 2006
Location: Texas
Posts: 1,998
Rep Power: 60
juven14 is a jewel in the rough
Default

Odds are its a bug in the validation process. If you reported it as a bug it might be helpful to post a link to it here.
__________________
John Snyder
PHP Developer
juven14 is offline   Reply With Quote
Old 01-08-2010, 06:41 PM   #3
Member
 
Join Date: Dec 2009
Posts: 53
Rep Power: 4
jonten123 is on a distinguished road
Default

Here�s a link to the posted bug Link

This might be of some help. The locations I added in the acp that starts with ��� looks strange in the database. For example, �rebo looks like Örebro in the database. That may also be why my a-z sorting is wrong with locations that starts with ���. The sorting look�s like this now on my site, a, �, �, b, c and so on when it should be like this xyz���.Can I prevent ��� to look strange in the database?
jonten123 is offline   Reply With Quote
Old 01-08-2010, 07:07 PM   #4
Moderator
 
juven14's Avatar
 
Join Date: Mar 2006
Location: Texas
Posts: 1,998
Rep Power: 60
juven14 is a jewel in the rough
Default

The character corruption occurs when you change the collation of the field, likely if you reenter it correctly from the admin or phpmyadmin it will display properly.
__________________
John Snyder
PHP Developer
juven14 is offline   Reply With Quote
Old 01-08-2010, 07:13 PM   #5
Member
 
Join Date: Dec 2009
Posts: 53
Rep Power: 4
jonten123 is on a distinguished road
Default

I deleted �rebro and added it again. Still the same. The reason I have changed the charset/collation back and forward is because my categories and locations never have sorted correctly. And I just found out that nobody can register a username with ��� which is a dealbreaker for me. That must work...

Last edited by jonten123; 01-08-2010 at 07:20 PM.
jonten123 is offline   Reply With Quote
Old 01-08-2010, 10:21 PM   #6
Moderator
 
juven14's Avatar
 
Join Date: Mar 2006
Location: Texas
Posts: 1,998
Rep Power: 60
juven14 is a jewel in the rough
Default

Have you seen this documentation and implemented it?

UTF-8 - 68 Classifieds

Also, be sure you add this: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> to the header in the layout.tpl file not the userjoin.tpl file.
__________________
John Snyder
PHP Developer
juven14 is offline   Reply With Quote
Old 01-09-2010, 05:53 AM   #7
Member
 
Join Date: Dec 2009
Posts: 53
Rep Power: 4
jonten123 is on a distinguished road
Default

Hello,

The only thing I haven�t done is adding this line to the mysql file: $this->query("set names utf8");. All I get is fatal error on my page when adding it. I tried to add it at the end after ;exit(199); and in the middle and in the beginning but still fatal error. What am I doing wrong?

Edit: Just found out that I cant add the code to the mysql file in the designer version. I wonder if my ��� problem will disappear if I upgrades to the developer version? Then I can add the $this->query("set names utf8"); to the mysql file.. What do you guys think?

Last edited by jonten123; 01-09-2010 at 06:38 AM.
jonten123 is offline   Reply With Quote
Old 01-09-2010, 08:37 AM   #8
curmudgeon
 
Join Date: Mar 2006
Posts: 5,229
Rep Power: 128
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

I would recommend submitting a trouble ticket with a link to this forum thread. Explaine you cant follow the unicode instructions because you dont have the developer version. Im betting they will send you a new file with that change made.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 01-13-2010, 09:50 AM   #9
Member
 
Join Date: Dec 2009
Posts: 53
Rep Power: 4
jonten123 is on a distinguished road
Default

Hello,

Got the file today and added the $this->query("set names utf8"); to it. But all I get is a blank page. My site is not working with that line included. Did I paste the code in the wrong place?

function connectToDb () {
// Make connection to MySQL server
if (!$this->dbConn = @mysql_connect($this->host, $this->dbUser,$this->dbPass))
{
throw_db_error('Database Error', 'Could not connect to server');
$this->connectError=true;
// Select database
}
else if ( !@mysql_select_db($this->dbName,$this->dbConn) )
{
throw_db_error('Database Error', 'Could not select database');
$this->connectError=true;
}
}
$this->query("set names utf8");
/**
* Disconnects from the database server
*
* @return bool TRUE on success, FALSE on failure
*/
jonten123 is offline   Reply With Quote
Old 01-13-2010, 10:28 AM   #10
curmudgeon
 
Join Date: Mar 2006
Posts: 5,229
Rep Power: 128
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Quote:
Originally Posted by jonten123
Hello,

Got the file today and added the $this->query("set names utf8"); to it. But all I get is a blank page. My site is not working with that line included. Did I paste the code in the wrong place?
Ii looks like you have it outside the function as outlined in the docs, should look like this.....

Code:
function connectToDb () {
		// Make connection to MySQL server
		if (!$this->dbConn = @mysql_connect($this->host, $this->dbUser,$this->dbPass)) 
		{
			throw_db_error('Database Error', 'Could not connect to server');
			$this->connectError=true;
			// Select database
		} 
		else if ( !@mysql_select_db($this->dbName,$this->dbConn) ) 
		{
			throw_db_error('Database Error', 'Could not select database');
			$this->connectError=true;
		}
                $this->query("set names utf8");
	}
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 01:36 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0