View Single Post
Old 02-02-2013, 12:37 AM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,168
Thanks: 59
Thanked 3,993 Times in 3,962 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
No, of course MS Word (or *ANY* good word processing program!) does not limit itself to the silly limited set of ASCII characters! Why would it *WANT* to?

Word processors *want* to use all those characters to make the final output look better.

So they use "smart quotes" and en-dashes and em-dashes and ellipses and much more
Quote:
He said, “now is the time for all ‘good’ men to come to!”
And he said it—loudly—tongue-in-cheek.
See smart quotes *AND* smart apostrophes there? And the em-dash? (You might call it "long dash".)

If you are going to allow people to paste word processed text into your <textarea>s, or even into standard text fields, then you will need to store the text as UNICODE and *NOT* as ASCII. In MySQL, that means storing the data as UTF8, most likely.

You can specify that all fields in a table are Unicode by putting the charset at the end of CREATE TABLE, thus:
Code:
CREATE TABLE mytable (
    name varchar(100),
    address varchar(50),
    city varchar(20)
) ENGINE = InnoDB DEFAULT CHARSET = utf8;
Or you can pick and choose which fields are unicode and which are not:
Code:
CREATE TABLE mixed (
    name varchar(100) CHARSET utf8,
    email varchar(50)
);
(Here, email will be the default character set of your current MySQL *installation*, likely CHARSET latin1, whereas name will be Unicode.)
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Users who have thanked Old Pedant for this post:
Eggweezer (02-02-2013)