special character problems

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
mayanktalwar1988
Forum Contributor
Posts: 133
Joined: Wed Jul 08, 2009 2:44 am

special character problems

Post by mayanktalwar1988 »

as stored in database
Sedra and Smith #8211; Circuits Microelectronics(in french)
as outputted in browser
Sedra and Smith – Circuits Microelectronics(in french)

my question is that i want to store the above text in database as its appear in browser.what can i do for it?
i am using latin_swedish_ci encoding and sql as a query language
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: special character problems

Post by Apollo »

I guess you meant – instead of #8211; (mind the & char).
But otherwise it seems correct, unicode char 8211 is the 'en dash' (semi long dash), so it's supposed to look like that. You could also use – instead of –

However, it's better just to use the normal dash char - and avoid freaky unicode dashes altogether. It probably came from someone typing your data in MS Word, which auto-replaces normal dashes and quotes with fancy versions.
mayanktalwar1988
Forum Contributor
Posts: 133
Joined: Wed Jul 08, 2009 2:44 am

Re: special character problems

Post by mayanktalwar1988 »

ya actually there is no problem with that as you said..but the thing is that i am extracting informationn from databse and storing it in the file so the encoded dash as stored in database get outputted in the file in encoded format .how to make it simply looklike normal dash instead of encoded character while outputting in file
Post Reply