If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > PHP > How PHP handles char ’ and Code Page?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-11-10, 10:39
wow wow is offline
Registered User
 
Join Date: Nov 2006
Posts: 3
How PHP handles char ’ and Code Page?

Hi every one,

When string contains "I’m vivacious", it gives me error near "x92m viv..." when trying to insert it into a MySQL table (note: ’ is not ' or `).

After using utf8_encode() converting to utf8, the insert op successes. But it shows as "I’m vivacious". How  can be avoided?

Thanks in advance,
Reply With Quote
  #2 (permalink)  
Old 08-11-10, 11:58
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,246
I'm pretty certain PHP has a MySQL function to encode the ' (HTMLSpecialEntities springs to mind)
if not then replace the ' with the suitable HTML safe encoding
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
Reply

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

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