Storing multiple character set types (or a representation of em) in a table column [message #172691] |
Fri, 25 February 2011 13:27 |
bizt
Messages: 2 Registered: February 2011
Karma:
|
Junior Member |
|
|
Hi,
I'm currently building an online tool designed to help users learn a
foreign language. It's aim is to allow the user to enter their own
vocabulary and they can quiz themselves. This involved entrering their
native word and then the foriend language equivelent. Kind of a
flashcard system but restricted to the words that the user has
previously entered - perhaps specific to the textbook they're
currently learning.
One of the things I want to allow is to support multiple character
sets though (e.g. alphanumeric, japanese, chinese...). I don't want
the system to be specific to a single character set (I'm currently
learning Japanese and want to use the system myself - so want to be
able to support english and japanese charcter sets). when designing my
database table columns I have to specify which character set the text
is though as I don't know any better. I understand why this is but
this is the first time I've ever wanted to have a single text field
support multiple character sets - or at least some representation of
them so I can turn them back to the original format when required.
What's the best way to do this? One idea is some way that I can store
the text in standard abc123... characters but specify in another field
what character set it is. So, when I am inserting my script will
detect which charcter set it is, take a note, encode to a abc123...
representation of it and then do the INSERT. Along side the abc123..
entry in another field I'll state the original character set so when i
need the data I'll decode the abc123... representation to it's
original form.
Anyway I've posted this in the PHP forum as with this technique above
it doesn't require me to do anything different to the database but
instead handle the encoding and decoding in the php script .. if
that's the best technique? How might this done in PHP? If anyone has
any suggestions I'd really appreciate it if you could reply.
Thanks
Burnsy
|
|
|