Nathan Given wrote:

Sorry I forgot this in the original post:

mysql version 4.0.18-nt
and
ColdFusion MX 6.1

Also, when I query from the command line (from windows), it doesn't work either (I get some weird characters, but not boxes or question marks).

Welcome to the wonderful world of encodings. Just be glad you're not dealing with Arabic.

However, I can assure you that Unicode works with MySQL, and, with some tweaks, PHP - I've done it, and I'm an eternal newbie on this list. Unfortunately, I don't know about ColdFusion. I know that Flash, that other Macromedia prooduct, doesn't fully support Unicode, but, if you grabbed the data using CF from Access, and it worked, it should also work with MySQL.

What most likely happened was that when you exported the data from Access to MySQL, the text got transcoded into ASCII, losing the accented chars. Many export utilities default to non-Unicode encodings.

If that is the problem, and you can't get the export to run in Unicode, here's the most extreme method I've ever done to transfer data from am Access DB to MySQL (and, yes, this is a complete HACK):

Write an ASP/PHP/JSP (whatever you're comfortable with) page that takes in a "GET" string of which record to start on (default to 0) and have it query the Access database for that record, fill the page with form fields that represent each field from the current record and fill them with the values from the current record, then put a JavaScript at the bottom of the page that submits that form data to another page. That other page takes that data and inserts it into the MySQL, then forwards it back to the first page, incrementing the record number in the GET var. The pages will loop until there are no more records to process. I did this once with 250,000 records, and let it run for a few days while I did other things.

The most important part here is to make sure to declare both pages as the desired encoding. If your Access DB uses UTF-8, then declare that encoding.

When you're done, if you look at the strings in the MySQL CLI, the accented chars will look like @~ or some other funky two-char combination. This is because MySQL is not Unicode aware. However, if you pull that data out using PHP (or CF?), and display it in a browser that is Unicode capable, on a page that has been declared UTF-8, the text will be as pretty as ever.

Here's an unfinished vocab system I wrote for BYU's Arabic program, completely in LAMP:
http://nmelrc.org/vocab/index.php?action=find_word&language=ar&field=word&operator=%3C%3E&value=

Trust me, if MySQL can store Arabic (a RTL, IMFS script) and have the browser render it properly, it can handle Spanish accents.

-jb

--------------------
BYU Unix Users Group http://uug.byu.edu/
The opinions expressed in this message are the responsibility of their
author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG. ___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to