Jump to content

Non-standard character input parsing scripts?


woolyg

Recommended Posts

Hi all,

 

I'm facing a project that will take input of data from forms submitted by users, but in a lot of cases, the user text that is input will have non-standard characters - examples:

 

à (HTML &agrave or &#68)

ö (HTML &ouml or &#87)

- semicolons omitted the html code for ease of reading

 

Has anyone used any WYSIWYG textarea scripts, or general javascripts, that automatically changes non-standard character input by the user into its HTML equivalent, for ease of storage in a database and ease of display later on?

 

The last thing I want to have display on the site is those annoying little boxes when a browser can't understand a character....!

 

All input appreciated.

WoolyG

Link to comment
Share on other sites

Thanks everyone.

neil.johnson - should I run that mysql query *directly* after connecting to the DB in each case?

 

Also, if I changed the encoding of all pages in the project to utf-8 instead of ISO-8859-1, should that suffice? I'm reading about the different types of encoding now.

 

Cheers for the valuable info - really appreciated.

Wooly

Link to comment
Share on other sites

Generally speaking I would have something along the lines of...

 

mysql_connect('blah', 'blah', 'blah');
mysql_select_db('blah');
mysql_query("SET NAMES UTF8");
mysql_query("SET CHARACTER SET UTF8");

Yes, that should suffice with regards to the encoding of the pages.

Link to comment
Share on other sites

Cool. Thanks guys for the informative replies. The project will start in english, and eventually incorporate indian characters, as well as some eastern european languages as well, so I'll take your advice, do some intense reading on the whole process, and get to changing my settings around.

 

Waynewex - as a fellow Irishman I am beside you in mourning the death of decency, honour, and innocence of the beautiful game. Tiocfaidh ár (fraincis) lá

 

Cheers everyone

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.