Waynn Lue wrote:

I'm getting a weird ^A character when I
try to print it out in a textarea field.

In that case, what character set does the browser think it should be using for the page? If you don't explicitly declare it, the browser has to guess, and you know what happens when you rely on a stupid computer to do thinking a human should have done instead.

You can either declare it for all pages on a site in your web server configuration (gets sent with HTTP headers), in the equivalent <meta> tag, or in an <?xml> tag if you're using XHTML.

I'm trying to figure out if
there's some weird interaction between htmlentities that's causing it
to be displayed strangely.

To debug problems like this, I recommend studying hex dumps of the relevant data at every stage along the path:

1. echo 'query' | mysql --user=fred --password=barney mydb | hexdump

2. write hex dump of query results to PHP debug log

3. packet capture of HTTP reply containing finished page

4. in browser, save web page to disk, and run through hexdump tool

You'll find that a) the data isn't stored correctly in the database; or b) it's being translated to another character set along the way (it happens!); or c) the browser is misinterpreting it because you didn't tell it what it needs to know to display it correctly.

> Can I trust that mysql is displaying the
text correctly on the command line tool if I have 4.1, even if the
charset is set to latin1?

Unless you're on a very old or strangely configured system, your terminal is probably configured for UTF-8. Since your DB is in Latin-1, there's a character set translation in there, and I can't confidently predict what will happen.

In this modern world, it's best to use some form of Unicode everywhere possible. Then the worst you have to deal with is conversion among encodings, which is annoying but lossless.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to