Re: Need Japanese character set files

2001-06-06 Thread Timothy Smith

On 2001 Jun 06, Anatole [EMAIL PROTECTED] wrote:
 
 I brought down mysqld and restarted as before with safe_mysqld
 --default-character-set=sjis and get the following error message when php
 tries to connect:
 
 Can't initialize character set 13 (path: default) in
 /usr/local/apache/sites/gaijinpot.com/php/common.inc

Ah, the vital clue.  You're using PHP, and probably used the
mysql that is bundled with PHP (an older version, too), and
not an external MySQL library.  The PHP version only comes
with the latin1 character set.  What you need to do is configure
PHP using their --with-mysql=/path/to/your/mysql option, and
make and install the new PHP.

Yes, this is kind of a pain, but that's how it goes.  If you
have trouble with this process, a PHP list is probably the best
place to get help.

Oh, you might be able to get around this by just using the most
recent version of PHP.  We added a hack to ignore the error you
are getting, since the client doesn't have to do much with the
character sets.  But I'm not sure if it will work when the server
is using a multi-byte character set - it might just break.  The
way to be sure that things work is to follow my instructions
above.  If you just upgrade your PHP, and things don't work, let
me know the error you get so maybe I can find a work-around.

Tim

-- 
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Tim Smith [EMAIL PROTECTED]
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Development Team
/_/  /_/\_, /___/\___\_\___/   Boone, NC  USA
   ___/   www.mysql.com

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Need Japanese character set files

2001-06-05 Thread Timothy Smith

On 2001 Jun 04, Narendra Phadke [EMAIL PROTECTED] wrote:
 
 I am storing Japanese data inside MySQL.
 MySQL supports all the Europian languages and other languages like korian
 and Hebru, and you have all the character set files for all these languages
 inside the C:\mysql\share\charsets directory.
 But this directory does not contain Japanese character set files. Where can
 I get these files?

Only single-byte character sets with simple sorting rules can be
described by the *.conf files.  More complex character sets must
be compiled into the server.

The binaries that MySQL distributes have all supported character
sets included.  You can see what character sets are available
with this command:

mysql show variables like 'character_sets';

You should notice ujis and sjis there, if you are using one of our
binaries.  If you compile MySQL yourself, you must specify the
character sets you want when you run 'configure', like this:

sh configure --with-charset=sjis --with-extra-charsets=ujis,gbk

When you start mysqld, you use the --default-character-set=ujis
option to change the character set being used.  Our binaries use
latin1 by default.  With the configuration line from above, the
default would be sjis, but you could specify ujis, gbk, or any
of the simple character sets in share/charsets/*.conf.

Tim

-- 
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Tim Smith [EMAIL PROTECTED]
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Development Team
/_/  /_/\_, /___/\___\_\___/   Boone, NC  USA
   ___/   www.mysql.com

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Need Japanese character set files

2001-06-05 Thread Anatole

 Only single-byte character sets with simple sorting rules can be
 described by the *.conf files.  More complex character sets must
 be compiled into the server.
 
 The binaries that MySQL distributes have all supported character
 sets included.  You can see what character sets are available
 with this command:
 
   mysql show variables like 'character_sets';
 
 You should notice ujis and sjis there, if you are using one of our
 binaries.

 When you start mysqld, you use the --default-character-set=ujis
 option to change the character set being used.  Our binaries use
 latin1 by default.  With the configuration line from above, the
 default would be sjis, but you could specify ujis, gbk, or any
 of the simple character sets in share/charsets/*.conf.

I installed MySQL from an RPM file on Linux. When I use the mysqlshow
variables like 'character_sets'; as you mentioned above, I do, indeed, show
sjis. So, I shutdown mysql and restarted it like this:
safe_mysqld --default-character-set=sjis

This resulted in an error message (sorry I forgot the one however something
it to do with missing charsets I believe). I had a look around and I noticed
the following charsets in /usr/share/mysql/charsets:

./croat.conf*greek.conf*  latin1.conf*   win1251.conf*
../   danish.conf*   hebrew.conf* latin2.conf*
win1251ukr.conf*
Index*dec8.conf* hp8.conf*latin5.conf*
README*   dos.conf*  hungarian.conf*  swe7.conf*
cp1251.conf*  estonia.conf*  koi8_ru.conf*usa7.conf*
cp1257.conf*  german1.conf*  koi8_ukr.conf*   win1250.conf*

Alas, no sjis, but I imagine that is because it a double-byte character set.

So, I'm left with the following question:
1. What do you mean by
More complex character sets must
 be compiled into the server.
And how would I go about doing this?

TIA

Anatole


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Need Japanese character set files

2001-06-05 Thread Timothy Smith

On 2001 Jun 06, Anatole [EMAIL PROTECTED] wrote:
 
 I installed MySQL from an RPM file on Linux. When I use the mysqlshow
 variables like 'character_sets'; as you mentioned above, I do, indeed, show
 sjis.

This means that the sjis character set is compiled into the server
already, so you do not need to recompile MySQL in order to use the
sjis character set.

 So, I shutdown mysql and restarted it like this:
 safe_mysqld --default-character-set=sjis
 
 This resulted in an error message (sorry I forgot the one however something
 it to do with missing charsets I believe).

I would need to know the error message in order to guess what is
going wrong.

 I had a look around and I noticed the following charsets in
 /usr/share/mysql/charsets:

cut

 Alas, no sjis, but I imagine that is because it a double-byte character set.

Yes.  If you had the source distribution, you would see the file
called strings/ctype-sjis.c, which contains the code needed to
handle the sjis character set.

 So, I'm left with the following question:
 1. What do you mean by
 More complex character sets must
  be compiled into the server.

In order to use the more complex character sets, such as sjis,
extra code must be linked into the mysqld binary.  When we build
our binary distributions, we do link in the extra code for all of
the more complex character sets.

 And how would I go about doing this?

You do not need to do this, since you are using a standard binary
that already includes all of the more complex character sets.

Tim

-- 
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Tim Smith [EMAIL PROTECTED]
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Development Team
/_/  /_/\_, /___/\___\_\___/   Boone, NC  USA
   ___/   www.mysql.com

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Need Japanese character set files

2001-06-05 Thread Anatole

Hi Tim,

Thanks for taking the time to write. You answered many questions that I
haven't been able to figure out so far about character sets.

The only thing I have left is...

 This resulted in an error message (sorry I forgot the one however something
 it to do with missing charsets I believe).
 
 I would need to know the error message in order to guess what is
 going wrong.

I brought down mysqld and restarted as before with safe_mysqld
--default-character-set=sjis and get the following error message when php
tries to connect:

Can't initialize character set 13 (path: default) in
/usr/local/apache/sites/gaijinpot.com/php/common.inc


Thanks again for your help!

Anatole


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php