diff options
author | acurtis@xiphis.org <> | 2005-08-11 12:18:53 +0100 |
---|---|---|
committer | acurtis@xiphis.org <> | 2005-08-11 12:18:53 +0100 |
commit | b9476f7d50e9911ea83f304351e5cab7a3880089 (patch) | |
tree | 7e424eae0123e35fa5eec3670a550a310c6e1916 /mysys/charset.c | |
parent | 0f75d647349694d820923342325440e9abdd49a6 (diff) | |
parent | 3b64651683a6f8d9276fd49843832f672312f880 (diff) | |
download | mariadb-git-b9476f7d50e9911ea83f304351e5cab7a3880089.tar.gz |
Merge xiphis.org:/usr/home/antony/work2/mysql-4.1
into xiphis.org:/usr/home/antony/work2/merge-5.0
Diffstat (limited to 'mysys/charset.c')
-rw-r--r-- | mysys/charset.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mysys/charset.c b/mysys/charset.c index 701170b747b..c02144fafc0 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -679,6 +679,32 @@ ulong escape_string_for_mysql(CHARSET_INFO *charset_info, } +#ifdef BACKSLASH_MBTAIL +static CHARSET_INFO *fs_cset_cache= NULL; + +CHARSET_INFO *fs_character_set() +{ + if (!fs_cset_cache) + { + char buf[10]= "cp"; + GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_IDEFAULTANSICODEPAGE, + buf+2, sizeof(buf)-3); + /* + We cannot call get_charset_by_name here + because fs_character_set() is executed before + LOCK_THD_charset mutex initialization, which + is used inside get_charset_by_name. + As we're now interested in cp932 only, + let's just detect it using strcmp(). + */ + fs_cset_cache= !strcmp(buf, "cp932") ? + &my_charset_cp932_japanese_ci : &my_charset_bin; + } + return fs_cset_cache; +} +#endif + + /* Escape apostrophes by doubling them up |