0

I'm losing the will to live!

I'm currently trying to place array values from php files into a mysql db table. As it happens some of the values have non-ASCII values:

e.g. “%1$s”

I seem to be able to encode all my usual accented characters, but the slanted inverted commas/quotes. They end up as some kind of gibberish:

“%1$sâ€.

My DB collation is UTF8/utf8_bin

My webpage encoding is UTF8

I have used:

mysql_query("SET NAMES 'utf8'");

as part of my connection procedure.

Background: this is for a phpBB language file translation, which is full of simple key-value arrays. I'm just reading the key+values and placing them into a table (id/key/value/translation).

I can enter slanted quotes into the DB manually, but then they don't show when retrieved (invisible).

Any ideas?

Edited by diafol: n/a

2
Contributors
2
Replies
5
Views
7 Years
Discussion Span
Last Post by diafol
0

though i didnt understand ur question clearly but almost same problem i m also facing..!! which is related utf-8

first of all tell where are you facing problem.? in displaying non-ascii values on browser or inserting in db..?

what i found is to convert the value into hexadecimal.. n insert it in db

0

OK Sam - I've finally cracked it (just now). I had (stupidly) placed a htmlentities() function upstream of the offending piece of code. As soon as I took this out - no problem. The db still stores gibberish, but at least it now displays properly in html. I also had to take out the mysql_query("SET NAMES 'utf8'");. Doh!

So solved.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.