[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [edict-jmdict] database schema
On 9/20/06, Stuart McGraw <smcg4191@frii.com> wrote:
Doesn't that make using mysql tools difficult, e.g. japanese
text viewed in the mysql query browser being mojibake?
In my experience it hasn't at least. Just bytes-in-bytes-out. As long
as your client is set up to handle UTF-8 it shouldn't matter, I think.
I get UTF-8 displaying fine in the commandline mysql client
application as well as web pages as long as the correct headers or
meta tags are set.
Anyhow, I think you might be running into trouble because you didn't
specify a character set for the tables or columns. Try creating your
tables like this:
CREATE TABLE gloss (
id INT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE PRIMARY KEY ,
sens INT UNSIGNED NOT NULL REFERENCES sens (id) ON DELETE CASCADE ,
ord MEDIUMINT NOT NULL ,
lang TINYINT UNSIGNED NOT NULL REFERENCES kwlang (id) ,
txt VARCHAR(2048) NOT NULL ,
note TEXT ) TYPE=InnoDB CHARACTER SET utf8;
The InnoDB argument should enable foreign key constraints as well.
This depends on a project's overall goals. If it is application-focused,
that is, there in a single application of primary importance, and the
database exists purely to support the application, I agree.
Yeah, you're right. However, as a software guy, it's my job to be
biased against DBA's and logic in the database. :)
> I'll probably have some more comments after I've gotten a chance to
> look over the files and play with them a bit.
Oops - I didn't get very far. The zip archive seems to be missing the
static keyword files in data/*.sql - I wasn't sure if they were
supposed to be created by one of the scripts or not, but it doesn't
look like it.
Also, I'm getting the following error (probably as a result of
skipping step 2 with the missing files):
pawel@fizzy:~/schema$ python load_jmdict.py JMdict_e
Traceback (most recent call last):
File "load_jmdict.py", line 636, in ?
main (args, opts)
File "load_jmdict.py", line 30, in main
parse_xmlfile (cursor, args[0], KW.SRC.jmdict.id, opts)
AttributeError: 'KwdRow' object has no attribute 'jmdict'
Using Python 2.4.4c0, elementtree 1.2.6-9, celementtree 1.0.5-8 and
mysqldb 1.2.1-p2-4 all on debian-testing. I could be doing something
wrong.
-Pawel