TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 12-19-2008, 02:25 AM   #1 (permalink)
The Contributor
 
Join Date: Feb 2007
Posts: 64
Thanks: 9
Killswitch is on a distinguished road
Default Unexpected characters in output

I am getting some weird characters in the output from my script. It is a light CMS that enters content in the database. When I output from the database, I get characters like  right after all periods.

What causes this? My database collation is latin1_swedish_ci and my template document sets the page as UTF8 ( browser is also showing UTF8 ).

Is this an encoding issue? I thought for a second maybe I should change the collation to UTF8, but there's so many choices in the database for that. Then I checked out UTF8_encode PHP function, but wasn't sure if I should all data entered into the database through this.
Killswitch is offline  
Reply With Quote
Old 12-19-2008, 10:23 AM   #2 (permalink)
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

Sounds like it to me, the data within the DB wont be utf therefore its not going to make a difference if you send 'utf8' headers.

You will have to change the DB encoding, a small article i found on the matter (assuming you use mysql)
http://www.khelll.com/blog/mysql/cha...latin-to-utf8/
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote
Old 12-20-2008, 04:29 AM   #3 (permalink)
The Contributor
 
Join Date: Feb 2007
Posts: 64
Thanks: 9
Killswitch is on a distinguished road
Default

Thanks, this seemed to solve the problem. Figured this was what was causing it.
Killswitch is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Security: Escape Output nuweb General 4 11-24-2008 08:00 PM
Smarty output buffering? Aaron Libraries & Extensions 4 08-13-2008 09:35 AM
Cleaning out unwanted characters Andrew General 6 10-20-2007 08:31 PM


All times are GMT. The time now is 12:44 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design