22850 Posts in 9874 Topics by 2803 members
|Go to End|
16 May 2011 at 11:27pm Last edited: 16 May 2011 11:34pm
I can remove them with...
return utf8_decode ($content);
... but why do these things keep appearing on sites? how can I rid myself of them for ever?
please help! it is driving me CRAZY!
17 May 2011 at 3:43am
I only see them crop up when I'm in Dev mode and I'm outputting stuff with Debug::show();
I would assume there is a character in one of the base classes that you'll have to find.
Now that I think about it, I've seen stuff like this crop up when my co-worker uses Dreamweaver to edit php files with the wysiwyg editor, you'll have to zap the gremlins.
17 May 2011 at 9:23am
Thanks, I did kinda throw it out there without much info... made me remember teh chinese outsurcers that left chinese comments in the code (amongst other things...)
It is coming from the database it gets into the content, page titles, etc.
I think it is after I run a mysqldump and then restore it (all via Lunix shell and without transferring the file out the box), but today just upgrading a site to 2.4.5 and running a db build did it this time...
any advice now I've been a bit more specific - any ideas? config settings? db settings?
all suggestions welcome
19 May 2011 at 3:55am
Thanks to FinBoWa on IRC...
SHOW VARIABLES LIKE 'character_set%';
SHOW VARIABLES LIKE 'collation%';
to see that my db was...
Then after running the following SQL (from http://muzso.hu/2008/04/09/how-to-change-the-character-set-and-or-collation-in-a-mysql-database-for-all-tables-and-c)
SELECT CONCAT('ALTER TABLE `', t.`TABLE_SCHEMA`, '`.`', t.`TABLE_NAME`, '` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;') as stmt
FROM `information_schema`.`TABLES` t
AND t.`TABLE_SCHEMA` = 'sm_sandbox'
ORDER BY 1
the collation is this...
I am removing the characters for the last time (hopefully) as my db should now be setup correctly, if not I'll update this thread...
23 May 2011 at 2:42am
I think you could also try to filter the input, and everytime someone introduces this kind of letters you will replace them with what ever you want..
23 May 2011 at 8:31pm
Thank you for the reply - in my case everyone is adding characters like... ', £ or just a space (for all I can tell) and then after a dev build or a backup and restore the strange characters appear. I did strip these characters when displaying "Content" - but it affects every HTMLText and Text field (again for as far as I can tell) - How would I easily filter it from all of these do you think? Create a custom HTMLTextField and TextField class? I'd be concerned that that is the wrong way to go about it...
21 June 2011 at 2:02am
so this now seems to have settled down... the solution was to add the following vhost.conf in the conf folder of the vhost...
|Go to Top|