33 KiB
33 KiB
PostgreSQL 7.3 multi-byte (MB) support README 2002/10/21 $B:n@.
$B@P0fC#IW
ishii@postgresql.org
$B"#$O$8$a$K
PostgreSQL $B$K$*$1$k%^%k%A%P%$%H%5%]!<%H$O0J2<$N$h$&$JFCD'$r;}$C$F$$$^$9!%
1. $B%^%k%A%P%$%HJ8;z$H$7$F!$F|K\8l!$Cf9q8l$J$I$N3F9q$N EUC$B!$Unicode$B!$
mule internal code, ISO-8859-* $B$,%G!<%?%Y!<%9:n@.;~$KA*Br2DG=!%
$B%G!<%?%Y!<%9$K$O$3$N%(%s%3!<%G%#%s%0$N$^$^3JG<$5$l$^$9!%
2. $B%F!<%V%kL>$K%^%k%A%P%$%HJ8;z$,;HMQ2DG=
3. $B%+%i%`L>$K%^%k%A%P%$%HJ8;z$,;HMQ2DG=
4. $B%G!<%?$=$N$b$N$K$b%^%k%A%P%$%HJ8;z$,;HMQ2DG=
5. $B%^%k%A%P%$%HJ8;z$N@55,I=8=8!:w$,;HMQ2DG=
6. $B%^%k%A%P%$%HJ8;z$N LIKE $B8!:w$,;HMQ2DG=
7. character_length(), position(), substring() $B$J$I$NJ8;zNs4X?t$G
$B$N%^%k%A%P%$%H%5%]!<%H
8. $B%U%m%s%H%(%s%IB&$N%(%s%3!<%G%#%s%0$,%P%C%/%(%s%IB&$H0[$k>l9g$K!$
$B<+F0E*$K%(%s%3!<%G%#%s%0JQ49$r9T$J$$$^$9!%
9. $B%f!<%6Dj5A$N%(%s%3!<%G%#%s%0JQ49$r:n@.2DG=!%
$B%^%k%A%P%$%H%5%]!<%H$,07$&$3$H$N$G$-$k%(%s%3!<%G%#%s%0$O0J2<$K$J$j$^
$B$9!%
SQL_ASCII ASCII
EUC_JP $BF|K\8l EUC
EUC_CN GB $B$r%Y!<%9$K$7$?CfJ8EUC$B!%code set 2 $B$O
SS2+2$B%P%$%H%3!<%I = 3$B%P%$%HI=8=$G$9!%
EUC_KR $B4Z9q8l EUC$B!%
JOHAB $B%O%s%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%s%0$H
$B$7$FSQL_ASCII$B$,:NMQ$5$l$F$7$^$&$N$G!$F|K\8l$r%G%U%)%k%H$G;HMQ$9$k>l
$B9g$O!$
-E EUC_JP
$B$"$k$$$O
--encoding=EUC_JP
$B$H$7$FI,$:L@<(E*$K%(%s%3!<%G%#%s%0$r;XDj$7$F$/$@$5$$!%
$B$J$*!$PostgreSQL 7.3$B0J9_%m%1!<%k%5%]!<%H$,I,$:M-8z$K$J$C$F$$$^$9$,!$
$B$3$l$OF|K\8l$J$I$r;HMQ$9$k:]$K$O2?$N%a%C%j%H$b$J$$$P$+$j$G$J$/!$>c32
$B$N860x$K$J$C$?$j!$LIKE$B8!:w$d@55,I=8=8!:w$G%$%s%G%C%/%9$,M-8z$K$J$i$J
$B$$$J$I$NLdBj$r0z$-5/$3$9$N$G!$L58z$K$7$F$*$/$3$H$r$*$9$9$a$7$^$9!%%m
$B%1!<%k%5%]!<%H$rL58z$K$9$k$?$a$K$O!$
--no-locale
$B%*%W%7%g%s$r;XDj$7$^$9!%
createdb $B$G$O0J2<$N%*%W%7%g%s$G%(%s%3!<%G%#%s%0$,;XDj$G$-$^$9!%
-E $B%(%s%3!<%G%#%s%0
--encoding=$B%(%s%3!<%G%#%s%0
create database $B$G$O0J2<$N%*%W%7%g%s$G%(%s%3!<%G%#%s%0$,;XDj$G$-$^$9!%
CREATE DATABASE dbanme WITH ENCODING = '$B%(%s%3!<%G%#%s%0';
LOCATION $B$rF1;~$K;XDj$9$k>l9g$O0J2<$N$h$&$K$J$j$^$9!%
CREATE DATABASE dbanme WITH LOCATION = 'path' ENCODING = '$B%(%s%3!<%G%#%s%0';
createdb/create database $B$G$O!$%(%s%3!<%G%#%s%0;XDj$r>JN,$7$?>l9g$O!$initdb
$B$G;XDj$7$?%(%s%3!<%G%#%s%0$,:NMQ$5$l$^$9!%$3$l$O!$initdb $B$,:n@.$9$k
$B%F%s%W%l!<%H%G!<%?%Y!<%9(template1)$B$N encoding $B%"%H%j%S%e!<%H$r7Q>5
$B$9$k$+$i$G$9!%
$B%G!<%?%Y!<%9$N%(%s%3!<%G%#%s%0$O!$psql -l$B!$psql $B$N \l $B$G;2>H$G$-$^$9!%
$ psql -l
List of databases
Database | Owner | Encoding
---------------+---------+---------------
euc_cn | t-ishii | EUC_CN
euc_jp | t-ishii | EUC_JP
euc_kr | t-ishii | EUC_KR
euc_tw | t-ishii | EUC_TW
mule_internal | t-ishii | MULE_INTERNAL
regression | t-ishii | SQL_ASCII
template1 | t-ishii | EUC_JP
test | t-ishii | EUC_JP
unicode | t-ishii | UNICODE
(9 rows)
$B"#J8;z7?$N%G!<%?7?$K$D$$$F
7.2$B$G$O!$CHAR(n)$B$HVARCHAR(n)$B$N n $B$OJ8;z?t$r0UL#$7$^$9!%n $B$,%P%$%H?t$r
$B0UL#$9$k 7.1 $B0JA0$H$O0[$J$j$^$9$N$G$4Cm0U2<$5$$!%
$BNc$r<($7$^$9!%
7.2$B$G$O!$CHAR(1)$B$K"$B$""$B$r3JG<$G$-$^$9$,!$7.1$B0JA0$G$O3JG<$G$-$^$;$s$3
$B$l$O!$"$B$""$B$r3JG<$9$k$?$a$K>/$J$/$H$b2$B%P%$%H0J>e$rMW$9$k$+$i$G$9!%
$B5U$K!$"a" $B$O1$B%P%$%H$7$+>CHq$7$J$$$?$a!$7.1$B$G$b CHAR(1) $B$K3JG<$G$-$^
$B$9!%
$B$J$*!$7.2$B$G$O!$7.1$B$^$G$H0[$J$j!$CHAR(n)$B$K3JG<$G$-$J$$ n $BJ8;z$h$jBg$-
$B$$J8;zNs$O n $BJ8;z$G@Z$j<N$F$i$l$k$N$G$O$J$/!$%(%i!<$K$J$k$3$H$K$4Cm
$B0U2<$5$$!%$3$l$O!$%^%k%A%P%$%HBP1~$NM-L5$K4X$o$i$:!$J8;zNs$N07$$$,
SQL$BI8=`$K1h$&$h$&$KJQ$C$?$+$i$G$9!%
$B"#%U%m%s%H%(%s%I$H%P%C%/%(%s%I$N<+F0%(%s%3!<%G%#%s%0JQ49$K$D$$$F
$B%P%C%/%(%s%I($B%G!<%?%Y!<%9)$B$H psql $B$J$I$N%U%m%s%H%(%s%I$N%(%s%3!<%G%#
$B%s%0$O0lCW$7$F$$$k$N$,86B'$G$9$,!$$$$/$D$+$N%(%s%3!<%G%#%s%0$K$D$$$F
$B$O%P%C%/%(%s%I$H%U%m%s%H%(%s%I$N4V$G0[$J$k$b$N$r;HMQ$9$k$3$H$,$G$-$^
$B$9!%$3$N>l9g!$<+F0E*$K%P%C%/%(%s%I$G%(%s%3!<%G%#%s%0JQ49$,9T$o$l$^$9!%
$B%P%C%/%(%s%I$N%(%s%3!<%G%#%s%0 $B5vMF$5$l$k%U%m%s%H%(%s%I$N
$B%(%s%3!<%G%#%s%0
----------------------------------------------------------------
EUC_JP EUC_JP, SJIS, UNICODE
EUC_TW EUC_TW, BIG5, UNICODE
EUC_CN EUC_CN, UNICODE
EUC_KR EUC_KR, UNICODE
JOHAB JOHAB, UNICODE
LATIN1,3,4 LATIN1,3,4, UNICODE
LATIN2 LATIN2, WIN1250, UNICODE
LATIN5 LATIN5, WIN, ALT, UNICODE
LATIN6,7,8,9,10 LATIN6,7,8,9,10, UNICODE
ISO_8859_5,6,7,8 ISO_8859_5,6,7,8, UNICODE
WIN1256 WIN1256, UNICODE
TCVN TCVN, UNICODE
WIN874 WIN874, UNICODE
MULE_INTERNAL EUC_JP, SJIS, EUC_KR, EUC_CN,
EUC_TW, BIG5, LATIN1$B$+$i5,
WIN, ALT, WIN1250
UNICODE EUC_JP, SJIS, EUC_KR, UHC,
EUC_CN, GBK, EUC_TW, BIG5,
LATIN1$B$+$i10, ISO_8859_5$B$+$i8,
WIN, ALT, WIN1250, WIN1256,
TCVN, WIN874, JOHAB
----------------------------------------------------------------
$B%P%C%/%(%s%I$H%U%m%s%H%(%s%I$N%(%s%3!<%G%#%s%0$,0[$J$k>l9g!$$=$N$3$H
$B$r%P%C%/%(%s%I$KEA$($kI,MW$,$"$j$^$9!%$=$N$?$a$NJ}K!$,$$$/$D$+$"$j$^
$B$9!%
o psql $B$N \encoding $B%3%^%s%I$r;H$&J}K!
psql$B$G$O!$\encoding$B%3%^%s%I$r;H$C$FF0E*$K%U%m%s%H%(%s%IB&$NJ8;z%3!<
$B%I$r@ZBX$($k$3$H$,$G$-$^$9!%Nc:
\encoding SJIS
o libpq $B$N4X?t PQsetClientEncoding $B$r;H$&J}K!
7.0 $B$+$i?7$7$$ libpq $B4X?t PQsetClientEncoding $B$,DI2C$5$l$F$$$^$9!%
PQsetClientEncoding(PGconn *conn, const char *encoding)
$B$3$N4X?t$r;H$($P!$%3%M%/%7%g%sKh$K%(%s%3!<%G%#%s%0$r@ZBX$($k$3$H$,$G
$B$-$^$9!%8=:_$N%(%s%3!<%G%#%s%0$NLd$$9g$o$;$O
int PQclientEncoding(const PGconn *conn)
$B$G$9!%
o postgresql.conf $B$G@_Dj$9$kJ}K!
$B%U%m%s%H%(%s%I$N%G%U%)%k%H%(%s%3!<%G%#%s%0$r;XDj$9$k$K$O!$
postgresql.conf $B$N client_encoding $B$r;XDj$7$^$9!%;XDjNc:
client_encoding = SJIS
o $B4D6-JQ?t PGCLIENTENCODING $B$r;H$&J}K!
(1) postmaster $B5/F0;~$K4D6-JQ?t$r@_Dj$9$kJ}K!
$B4D6-JQ?t PGCLIENTENCODING $B$r@_Dj$9$k$3$H$K$h$j!$ postgresql.conf $B$G
$B%(%s%3!<%G%#%s%0$r;XDj$9$k$N$HF1$88z2L$,F@$i$l$^$9!%$?$@$7!$$3$l$ONr
$B;KE*7P0^$+$i;D$5$l$F$$$k5!G=$G!$:#8e$O$3$N5!G=$rMxMQ$7$J$$$3$H$r$*$9
$B$9$a$7$^$9!%@_DjNc:
export PGCLIENTENCODING=SJIS postmaster -S
(2) $B%/%i%$%"%s%H!$%U%m%s%H%(%s%IKh$K%(%s%3!<%G%#%s%0$r@_Dj$7$?$$>l9g
$B$=$N%U%m%s%H%(%s%I($B$?$H$($P psql)$B$r5/F0$9$kA0$K4D6-JQ?t
PGCLIENTENCODING $B$r@_Dj$7$^$9!%
o set client_encoding $B%3%^%s%I$r;H$&J}K!
SET CLIENT_ENCODING SQL$B%3%^%s%I$r;H$C$FF0E*$K%U%m%s%H%(%s%I$N%(%s%3!<
$B%G%#%s%0$rJQ99$G$-$^$9!%Nc:
SET CLIENT_ENCODING TO SJIS;
$B"#8=:_@_Dj$5$l$F$$$k%U%m%s%H%(%s%IB&$N%(%s%3!<%G%#%s%0$rD4$Y$k
$B8=:_@_Dj$5$l$F$$$k%U%m%s%H%(%s%IB&$N%(%s%3!<%G%#%s%0$O
show client_encoding;
$B$G;2>H$G$-$^$9($B>.J8;z$GI=<($5$l$^$9)$B!%
$B"#%G%U%)%k%H$N%(%s%3!<%G%#%s%0$X$NI|5"
SQL$B%3%^%s%I:
RESET CLIENT_ENCODING;
$B$O!$%G%U%)%k%H$N%U%m%s%H%(%s%I%(%s%3!<%G%#%s%0@_Dj$KI|5"$5$;$^$9!%
postmaster$B$rN)$A>e$2$k$H$-$K postgresql.conf $B$N client_encoding $B$d4D
$B6-JQ?t PGCLIENTENCODING $B$,@_Dj$5$l$F$$$k$H$=$N%(%s%3!<%G%#%s%0$K!$$=
$B$&$G$J$1$l$P%G!<%?%Y!<%9$N%(%s%3!<%G%#%s%0$HF1$8$K$J$j$^$9!%
$B"#L@<(E*$J%(%s%3!<%G%#%s%0JQ49
7.2$B$G$O!$convert$B$H$$$&4X?t$r;H$$!$L@<(E*$J%(%s%3!<%G%#%s%0JQ49$,$G$-
$B$^$9!%
convert(string text, [src_encoding name,] dest_encoding name)
$B$3$3$Gsrc_encoding$B$Otext$B$N%(%s%3!<%G%#%s%0L>$G$9!%>JN,$9$k$H!$%G!<%?
$B%Y!<%9%(%s%3!<%G%#%s%0L>$HF1$8$G$"$k$H8+$J$5$l$^$9!%dest_encoding$B$O!$
$BJQ498e$N%(%s%3!<%G%#%s%0L>$G$9!%
$BNc$r<($7$^$9!%
SELECT convert(text, EUC_JP) FROM unicode_tbl;
$B$O!$Unicode$B$N%F!<%V%kunicode_tbl$B$Ntext$BNs$rEUC_JP$B$KJQ49$7$FJV$7$^$9!%
7.3$B$G$O$5$i$KSQL$BI8=`$NCONVERT$B4X?t$,;H$($^$9!%SQL$BI8=`$NCONVERT$B$O
PostgreSQL$B$NCONVERT$B$H5!G=$O$[$H$s$IF1$8$G$9$,!$8F$S=P$77A<0$,0[$j$^
$B$9!%
SELECT convert(text using euc_jp_to_utf_8) FROM unicode_tbl;
"using" $B$N8e$N0z?t$O!V%3%s%P!<%8%g%sL>!W$G$9!%$3$NNc$G$O!$EUC_JP $B$+
$B$i UTF-8 $B$KJQ49$9$k%3%s%P!<%8%g%s$r;XDj$7$F$$$^$9!%Dj5A:Q$N%3%s%P!<
$B%8%g%s$K$D$$$F$O!$%f!<%6!<%:%,%$%I$N "String Functions and
Operators" $B$NI="Built-in Conversions" $B$r8+$F$/$@$5$$!%
$B"#%(%s%3!<%G%#%s%0JQ49ITG=$N>l9g$N=hM}
$B%P%C%/%(%s%IB&$N%(%s%3!<%G%#%s%0$H%U%m%s%H%(%s%IB&$N%(%s%3!<%G%#%s%0
$B$,$$$D$bAj8_JQ49$G$-$k$H$O8B$j$^$;$s!%6KC<$JOC!$%P%C%/%(%s%IB&$,
EUC_JP $B$J$N$K!$%U%m%s%H%(%s%IB&$, EUC_KR $B$@$C$?$i$I$&$J$k$G$7$g$&!%
$B$3$N>l9g PostgreSQL $B$OJQ49$G$-$J$$%3!<%I$r 16$B?JI=8=$KJQ49$7$^$9!%
$B$?$H$($P!$"(bdae)" $B$N$h$&$K!%$J$*!$$3$N 16$B?JI=8=$O mule
internal code $B$N%3!<%I$G$"$k$3$H$KCm0U$7$F2<$5$$!%$3$l$O!$D>@\%U%m%s
$B%H%(%s%I <--> $B%P%C%/%(%s%I$N%(%s%3!<%G%#%s%0$rJQ49$9$k$N$G$O$J$/!$0l
$BEYFbItI=8=$G$"$k mule internal code $B$r7PM3$7$F$$$k$?$a$G$9!%
$B$J$*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.$G$-$k$h$&$K$J$C
$B$F$$$^$9!%%3%s%P!<%8%g%s$NDj5A$O CREATE CONVERSION $B$H$$$& SQL $B%3%^%s
$B%I$r;H$C$F9T$$$^$9!%
CREATE [DEFAULT] CONVERSION conversion_name
FOR source_encoding
TO dest_encoding FROM funcname
$B>\:Y$O%j%U%!%l%s%9%^%K%e%"%k$r$4Mw2<$5$$!%
$B"#SJIS$B%f!<%6Dj5AJ8;z$X$NBP1~
7.0 $B$+$i SJIS$B%f!<%6Dj5AJ8;z (UDC) $B$KBP1~$7$F$$$^$9!%UDC $B$r$I$&07$&$+
$B$H8@$&$3$H$K$D$$$FCf>r$5$s(nak@email.com)$B$+$iLdBjDs5/$H>\:Y$J2r@b$r
$BD:$-$^$7$?$N$G!$;29M$N$?$a$K$3$N%I%-%e%a%s%H$N:G8e$KIU$1$F$*$-$^$9!%
$B$^$?!$$3$NLdBj$K$D$$$F$O!$PostgreSQL$BF|K\8l%a!<%j%s%0%j%9%H$N
[pgsql-jp 12288] (1999/12/17$BIU)$B$H [pgsql-jp 12486] (2000/1/5$BIU) $B$+$i
$B;O$^$k%9%l%C%I$G5DO@$r8+$k$3$H$,$G$-$^$9($B%a!<%k$N%"!<%+%$%V$O
http://www.sra.co.jp/people/t-ishii/PostgreSQL/ $B$G;2>H$G$-$^$9)$B!%
$B$3$3$G$O!$$=$l$i$N5DO@$r$U$^$(!$4JC1$K2r@b$7$^$9!%
PostgreSQL$B$G$O!$F|K\8l$r;HMQ$9$k:]$K%P%C%/%(%s%IB&$N%(%s%3!<%G%#%s%0
$B$r EUC_JP $B$^$?$O MULE_INTERNAL or Unicode $B$K$9$kI,MW$,$"$j$^$9!%
MULE_INTERNAL $B$O EUC_JP $B$KJ8;z=89g$rI=$9%3!<%I$rIU$1$?$b$N$J$N$G!$K\
$B<AE*$KF1$8$G$9!%$^$?!$Unicode <---> SJIS $BJQ49$O8=:_$N$H$3$m%5%]!<%H
$B$5$l$F$$$^$;$s$N$GL5;k$7$^$9!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)$B!%Unicode
organization$B$NDs6!$9$kJQ49%F!<%V%k$O:FG[I[$,5v2D$5$l$F$$$J$$$?$a!$
PostgreSQL$B$N%=!<%9%3!<%I$K$O4^$^$l$F$$$^$;$s!%0J2<!$;HMQ$7$?JQ49%F!<
$B%V%k$rNs5s$7$^$9!%
$B%(%s%3!<%G%#%s%0 $BJQ49%F!<%V%k
============================================================
ISO 8859-1 $B$J$7
ISO 8859-2 8859-2.TXT
ISO 8859-3 8859-3.TXT
ISO 8859-4 8859-4.TXT
ISO 8859-5 8859-5.TXT
ISO 8859-6 8859-6.TXT
ISO 8859-7 8859-7.TXT
ISO 8859-8 8859-8.TXT
ISO 8859-9 8859-9.TXT
ISO 8859-10 8859-10.TXT
ISO 8859-13 8859-13.TXT
ISO 8859-14 8859-14.TXT
ISO 8859-15 8859-15.TXT
ISO 8859-16 8859-16.TXT
EUC_JP JIS0201.TXT, JIS0208.TXT, JIS0212.TXT,
CP932.TXT, sjis.map
SJIS CP932.TXT
EUC_CN GB2312.TXT
GBK CP936.TXT
EUC_KR KSX1001.TXT
UHC CP949.TXT
JOHAB JOHAB.TXT
EUC_TW CNS11643.TXT
Big5 BIG5.TXT
WIN1256 CP1256.TXT
TCVN CP1258.TXT
WIN874 CP874.TXT
============================================================
$B<U<-!'
o $BFA2H@$B;06(1?M"%5!<%S%9$5$s$+$i!$CP932.TXT$B$h$j@8@.$7$?SJIS$BMQ$NJQ49%F!<
$B%V%k$rDs6!$7$F$$$?$@$-$^$7$?!%$3$l$K$h$j!$IBM $B3HD%J8;zNN0h (SJIS
115$B!A120 $B6h), NEC $BA*Dj IBM $B3HD%J8;zNN0h (SJIS 89$B!A92 $B6h)$B$KBP1~$9$k
$B$3$H$,$G$-$k$h$&$K$J$j$^$7$?!%
$B;29M1$B!'
Pavel Behal$B;a$K$h$jDs6!$5$l$?WIN1250$B%5%]!<%H$G$9$,!$Windows$B4D6-$G$N
$BMxMQ$N;EJ}$K$D$$$F;29M$K$J$k%I%-%e%a%s%H$,IUB0$7$F$$$k$N$G!$$3$3$KE:
$BIU$7$F$*$-$^$9!%
-------------------------------------------------------------------
Version: 0.91 for PgSQL 6.5
Author: Pavel Behal
Revised by: Tatsuo Ishii
Email: behal@opf.slu.cz
Licence: The Same as PostgreSQL
Sorry for my Eglish and C code, I'm not native :-)
!!!!!!!!!!!!!!!!!!!!!!!!! NO WARRANTY !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Instalation:
------------
1) Change three affected files in source directories
(I don't have time to create proper patch diffs, I don't know how)
[PostgreSQL 6.5.1$B$G$O$3$N%9%F%C%W$OI,MW$"$j$^$;$s!%-- $B@P0f]
2) Compile with enabled locale and multibyte set to LATIN2
3) Setup properly your instalation, do not forget to create locale
variables in your profile (environment). Ex. (may not be exactly true):
LC_ALL=cs_CZ.ISO8859-2
LC_COLLATE=cs_CZ.ISO8859-2
LC_CTYPE=cs_CZ.ISO8859-2
LC_MONETARY=cs_CZ.ISO8859-2
LC_NUMERIC=cs_CZ.ISO8859-2
LC_TIME=cs_CZ.ISO8859-2
4) You have to start the postmaster with locales set!
5) Try it with Czech language, it have to sort
5) Install ODBC driver for PgSQL into your M$ Windows
6) Setup properly your data source. Include this line in your ODBC
configuration dialog in field "Connect Settings:" :
SET CLIENT_ENCODING = 'WIN1250';
7) Now try it again, but in Windows with ODBC.
Description:
------------
- Depends on proper system locales, tested with RH6.0 and Slackware 3.6,
with cs_CZ.iso8859-2 loacle
- Never try to set-up server multibyte database encoding to WIN1250,
always use LATIN2 instead. There is not WIN1250 locale in Unix
- WIN1250 encoding is useable only for M$W ODBC clients. The characters are
on thy fly re-coded, to be displayed and stored back properly
Important:
----------
- it reorders your sort order depending on your LC_... setting, so don't be
confused with regression tests, they don't use locale
- "ch" is corectly sorted only in some newer locales (Ex. RH6.0)
- you have to insert money as '162,50' (with comma in aphostrophes!)
- not tested properly
-------------------------------------------------------------------
$B;29M2$B!'SJIS$B%f!<%6Dj5AJ8;z (UDC) $B$r$I$&07$&$+$H8@$&$3$H$K$D$$$FCf>r$5$s
(nak@email.com)$B$+$i$$$?$@$$$?LdBjDs5/$H2r@b$G$9!%
-------------------------- $B0zMQ3+;O ----------------------------------
---
1. SJIS $B%3!<%I$NHO0O
1 $B%P%$%HL\ 0x81 - 0x9F$B!$0xE0 - 0xFC
2 $B%P%$%HL\ 0x40 - 0x7E$B!$0x80 - 0xFC
$B$$$o$f$k!V30;zNN0h!W$NHO0O:
- X0208 $B6&DL<+M3NN0h
|--------------------
| 85 $B6h 0xEB40 $B!A
|...
|--------------------
| 89 $B6h 0xED40 $B!A ; 89$B!A92 $B6h$O
|... ; $B!VNEC $BA*Dj IBM $B3HD%J8;zNN0h!W
|-------------------- ; $B$H8F$P$l$k
| 93 $B6h 0xEF40 $B!A
| 94 $B6h 0xEF9F $B!A 0xEFFC
- $B%f!<%6Dj5AJ8;zNN0h
|--------------------
| 95 $B6h 0xF040 $B!A ; 95$B!A104 $B6h
|... ; $B!V%f!<%6Dj5AJ8;zNN0h A$B!W($B2>>N)
|--------------------
|105 $B6h 0xF540 $B!A ; 105$B!A114 $B6h
|... ; $B!V%f!<%6Dj5AJ8;zNN0h B$B!W($B2>>N)
|--------------------
|115 $B6h 0xFA40 $B!A ; 115$B!A120 $B6h$O0lHL$K
|... ; $B!VIBM $B3HD%J8;zNN0h!W
|120 $B6h ... ; $B$H8F$P$l$k
|--------------------
---
2. i-mode $BC<Kv$,;H$C$F$$$k?^7AJ8;z%3!<%I$NHO0O
0xF89F - 0xF8FC (112 $B6h)
0xF940 - 0xF949 (113 $B6h)
0xF972 - 0xF97E (113 $B6h)
0xF980 - 0xF990 (113 $B6h)
0xF9B0 (114 $B6h)
---
3. $B0lHLE*$J EUC $BF|K\8l%3!<%I$NDj5A
G0 : [0x21-0x7E] ; $B$$$o$f$k JIS ROMAN
G1 : [0xA1-0xFE] [0xA1-0xFE] ; JIS X 0208
G2 : 0x8E [0xA1-0xDF] ; JIS X 0201 $B%+%J
G3 : 0x8F [0xA1-0xF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B$H EUC $B$N%^%C%T%s%0$,%Y%s%@$K
$B$h$C$F0[$J$k$?$a!$Aj8_1?MQ$N:]$KLdBj$K$J$C$F$$$k$3$H$+$i!$1996
$BG/$K OSF $BF|K\%Y%s%@6(5D2q$,8!F$:n@.$7$?Js9p=q$,%Y!<%9$K$J$C$F$$
$B$k$h$&$G$9!%
Solaris $B$N%I%-%e%a%s%H$K$O!VTOG $BF|K\%Y%s%@6(5D2q?d>) EUC$B!&%7%U%H
JIS $B%3!<%IJQ49;EMM!W$K$b$H$E$/$H=q$$$F$"$j!$Solaris 2.6 $B$+$iF3F~
$B$7$F$$$k$N$@$=$&$G!$;d$+$i8+$l$P;v<B>e$NI8=`$H9M$($F$bIT<+A3$G$O
$B$J$$$H46$8$^$9!%
$B$J$*!$>/$J$/$H$b 1996 $BG/Ev;~$K$*$$$F$O!$Oracle $B$d Sybase $B$O
SJIS $B$N%f!<%6Dj5A/$B%Y%s%@Dj5AJ8;zNN0h$r EUC $B$KJQ49$9$k:]!$H=JLIT
$B2DG=J8;z$H$7$F07$C$F$$$k$i$7$$$H$$$&$3$H$bJdB-$7$F$*$-$^$9!%
---
[$B;29M;qNA]
// URL $B$,D9$$$N$G!$ESCf$G@Z$l$J$$$H$$$$$N$G$9$,...
-$B!VF|K\8l EUC$B!&%7%U%H JIS $B%3!<%IJQ49;EMM$H%3!<%I7O<BBVD4::!W
1966, OSF $BF|K\%Y%s%@6(5D2q
http://www.opengroup.or.jp/jvc/cde/sjis-euc.html
-$B!VJ8;z%3!<%IJQ495,B'!W
Solaris 7$B!$JFP $B%f!<%6!<%:%,%$%I
http://docs.sun.com/ab2/coll.139.3/JFPUG/@Ab2PageView/11683?Ab2Lang=ja&Ab2Enc=euc-jp
-$B!VF|K\8lJ8;z%3!<%I!W
Solaris 7$B!$JFP $B%f!<%6!<%:%,%$%I
http://docs.sun.com/ab2/coll.139.3/JFPUG/@Ab2PageView/879;td=5?Ab2Lang=ja&Ab2Enc=euc-jp
// $BFf$N!V1$B!A20 $B6h!W$N5-=R$O$3$3$+$i$-$F$$$^$9!%
---
-------------------------- $B0zMQ$3$3$^$G ---------------------------------
$B2~DjMzNr!'
2002/10/21
* $B%^%k%A%P%$%HBP1~$,%*%W%7%g%s$G$O$J$/!$8GDj$GI,$:AH$_9~$^$l$k
$B$h$&$K$J$j$^$7$?!%
* CREATE CONVERSION/DROP CONVERSION$B$NDI2C!%$3$l$K$H$b$J$$!$%(
$B%s%3!<%G%#%s%0JQ494X?t$,%m!<%@%V%k4X?t$K$J$j!$%P%C%/%(%s%I$N
$B%m!<%I%b%8%e!<%k%5%$%:$,7.2$B$h$j$b>.$5$/$J$C$F$$$^$9!%$^$?!$
SQL$BI8=`$NCONVERT$B4X?t$rDI2C$7$^$7$?!%
* $B$$$/$D$+%(%s%3!<%G%#%s%0$,DI2C$5$l$F$$$^$9!%
* $B0J>e!$7.3$B$KH?1G$5$l$^$9!%
2001/10/01
* CONVERT$B$NDI2C!%lpad/rpad/trim/btrim/ltrim/rtrim/translate$B$N
$B%^%k%A%P%$%HBP1~DI2C!%char/varchar$B$G%P%$%H?t$G$O$J$/!$J8;z?t
$B$G%5%$%:$rDj5A$9$k$h$&$KJQ99!%0J>e!$7.2$B$KH?1G$5$l$^$9!%
2001/2/15
* $BFA2H@$B;06(1?M"%5!<%S%9$5$s$+$i!$CP932.TXT$B$h$j@8@.$7$?SJIS$BMQ$N
$BJQ49%F!<%V%k$rDs6!$7$F$$$?$@$-$^$7$?!%7.1$B$KH?1G$5$l$^$9!%
2001/1/6
* UNICODE$B$HB>$N%(%s%3!<%G%#%s%0$H$NAj8_JQ495!G=$rDI2C!%
* 7.1$B$KH?1G$5$l$^$9!%
2000/5/20
* NEC $BA*Dj IBM $B4A;zBP1~$rDI2C$7$^$7$?!%$3$l$O $BFA2H@$B;06(1?M"%5!<%S%9
$B$5$s$+$i$N contribute $B$G$9!%
* $B$3$l$i$O!$7.0.1 $B$KH?1G$5$l$^$9!%
2000/3/22
* PQsetClientEncoding, PQclientEncoding $B$rlibpq $B4X?t$KDI2C!$
$B%3%M%/%7%g%sKh$K%(%s%3!<%G%#%s%0$rJQ992DG=$K!%
* SJIS $B%f!<%6Dj5AJ8;z (UDC) $B$X$NBP1~
* ./configure --with-mb=EUC_JP $B$+$i
./configure --enable-multibyte=EUC_JP $B$KJQ99
* SQL_ASCII $B$N regression test $BDI2C
* $B$3$l$i$O 7.0 $B$KH?1G$5$l$^$9!%
1999/7/11 WIN1250(Windows$BMQ$N%A%'%38l)$B%5%]!<%H$rDI2C$7$^$7$?!%
* WIN1250 $B$,%U%m%s%H%(%s%IB&$N%(%s%3!<%G%#%s%0$H$7$FMxMQ$G$-$k$h
$B$&$K$J$j$^$7$?!%$3$N>l9g!$%P%C%/%(%s%IB&$N%(%s%3!<%G%#%s%0$O
LATIN2 $B$^$?$O MULE_INTERNAL $B$H$7$^$9!%
(contributed by Pavel Behal)
* backend/utils/mb/conv.c$B$K$*$1$k7?$NIT@09g$r=$@5$7$^$7$?!%
(contributed by Tomoaki Nishiyama)
* $B$3$l$i$O6.5.1$B$KH?1G$5$l$^$9!%
1999/3/23 $B%-%j%kJ8;z%5%]!<%HDI2CB>(6.5 $B$KH?1G:Q)
* $B%(%s%3!<%G%#%s%0$H$7$F KOI8(KOI8-R), WIN(CP1251), ALT(CP866) $B$r
$B%5%]!<%H$7$F$$$^$9!%$3$l$i$O!$%U%m%s%H%(%s%I!$%P%C%/%(%s%I!$
$B$I$A$i$N%(%s%3!<%G%#%s%0$H$7$F$b;HMQ2DG=$G$"$j!$%(%s%3!<%G%#%s%0$N
$BAj8_JQ49$,2DG=$G$9!%$^$?!$=>Mh$+$i%5%]!<%H$7$F$$$k ISO 8859-5 $B$b
$BF1MM$K;HMQ2DG=$G$9!%
$B%-%j%kJ8;z%5%]!<%H$O!$Oleg Broytmann <phd@sun.med.ru> $B;a$N
$B%j%/%(%9%H5Z$S6(NO$K$h$j<B8=$7$^$7$?!%$3$l$O!$=>Mh$+$i$"$k
RCODE $B%5%]!<%H$N5!G=$r<h$j9~$`$b$N$G$b$"$j$^$9!%
* MB $B$H locale $B$rF1;~$K;XDj$7$?>l9g$KBgJ8;z!?>.J8;z$rL5;k$7$?
$B@55,I=8=8!:w$,@5>o$KF0:n$7$J$$%P%0$r=$@5
1999/1/26 Big5 $B%5%]!<%HDI2C(6.4.2-patched/6.5 $B$KH?1G:Q)
* Big5 $B$,%U%m%s%H%(%s%IB&$N%(%s%3!<%G%#%s%0$H$7$FMxMQ$G$-$k$h
$B$&$K$J$j$^$7$?!%$3$N>l9g!$%P%C%/%(%s%IB&$N%(%s%3!<%G%#%s%0$O
EUC_TW $B$^$?$O MULE_INTERNAL $B$H$7$^$9!%
* EUC_TW $B$N regression test $B%1!<%9$rDI2C
(contributed by Jonah Kuo <jonahkuo@mail.ttn.com.tw>)
1998/12/16 $BK\%I%-%e%a%s%H=$@5(6.4.2 $B$KH?1G:Q)$B!%
* Makefile.custom $B$G MB=EUC_JP $B$J$I$H@_Dj$9$kJ}K!$O 6.4 $B0J9_
$B%5%]!<%H$5$l$F$$$J$$$N$G:o=|$7$?!%
* $BJ8;z%3!<%I $B"* $B%(%s%3!<%G%#%s%0!$%/%i%$%"%s%H"*%U%m%s%H%(%s%I
$B%5!<%P"*%P%C%/%(%s%I $B$K$=$l$>$l8l6g$r=$@5!%
1998/12/15 6.4 $B8~$1%P%0=$@5%Q%C%A%j%j!<%9(6.4.2 $B$KH?1G:Q)$B!%
* SQL_ASCII $B%5%]!<%H$N%P%0=$@5
1998/11/21 6.4 $B8~$1%P%0=$@5%Q%C%A%j%j!<%9(6.4.2 $B$KH?1G:Q)$B!%
* BINARY CURSOR $B$NLdBj$r=$@5
* pg_dumpall $B$N%P%0=$@5
1998/11/5 6.4 $B%j%j!<%9!%
* pg_database $B$N encoding $B%+%i%`$, MB $B$,M-8z$G$J$$$H$-$K$b
$BDI2C$5$l$k$h$&$K$J$C$?!%$=$N$?$a!$MB $B$,M-8z$G$J$$$H$-$K$O!$
ASCII $B$N%(%s%3!<%G%#%s%0$rI=$9 SQL_ASCII $B$r?7$7$$%(%s%3!<%G%#%s%0
$B$H$7$FDI2C$7$?!%$3$l$K$H$b$J$$!$%(%s%3!<%G%#%s%0L>$KBP1~$9$k
$B%(%s%3!<%G%#%s%0ID$B$, SQL_ASCII $B$r 0 $B$H$9$kHV9f$KJQ99$K$J$C$?!%
1998/7/22 6.4 $B&A8~$1$K%Q%C%A$r%j%j!<%9!%
* initdb/createdb/create database $B$G%P%C%/%(%s%IB&$N
$B%(%s%3!<%G%#%s%0$r@_Dj$-$k5!G=<BAu!%$3$N$?$a!$%7%9%F%`%+%?%m
$B%0$N pg_database $B$K?7$7$$%+%i%` encoding $B$rDI2C(MB$B$,M-8z$J;~$@$1)
* copy $B$, PGCLIENTENCODING $B$KBP1~
* SQL92 $B$N "SET NAMES" $B$r%5%]!<%H(MB$B$,M-8z$J;~$@$1)
* LATIN2-5 $B$r%5%]!<%H
* regression test $B$K unicode $B$N%F%9%H%1!<%9$rDI2C
* MB $B@lMQ$N regression $B%F%9%H%G%#%l%/%H%j test/mb $B$rDI2C
* $B%=!<%9%U%!%$%k$NCV$->l=j$rBgI}8+D>$7!%MB $B4X78$O
include/mb, backend/utils/mb $B$KCV$/$h$&$K$7$?
1998/5/25 $B%P%0=$@5(mb_b3.patch $B$H$7$F pgsql-jp ML $B$K%j%j!<%9!$
$BK\2H$G$O 6.4 snapshot $B$K<h$j9~$^$l$kM=Dj)
1998/5/18 $B5!G=DI2C!?%P%0=$@5(mb_b2.patch $B$H$7$F pgsql-jp ML $B$K%j%j!<%9!$
$BK\2H$G$O 6.4 snapshot $B$K<h$j9~$^$l$kM=Dj)
* $B4D6-JQ?t PGCLIENTENCODING $B$N%5%]!<%H!%%U%m%s%H%(%s%IB&$N
$B%(%s%3!<%G%#%s%0$r;XDj$9$k!%8=:_!$SJIS, EUC_*, MULE_INTERNAL,
LATIN1 $B$,;XDj$G$-$k!%$^$?!$
set client_encoding to 'sjis';
$B$G$b2DG=
* 8bit $BJ8;z$,EO$k$HLdBj$,5/$-$k2U=j$K$G$-$k$@$1BP1~
1998/4/21 $B5!G=DI2C!?%P%0=$@5(mb_b1.patch $B$H$7$F pgsql-jp ML $B$K%j%j!<%9!$
$BK\2H$G$O 6.4 snapshot $B$K<h$j9~$^$l$F$$$k)
* character_length(), position(), substring() $B$N%^%k%A%P%$%H
$BBP1~
* octet_length() $BDI2C $B"* initdb $B$N$d$jD>$7I,MW
* configure $B$N%*%W%7%g%s$K MB $B%5%]!<%HDI2C
(ex. configure --with-mb=EUC_JP)
* EUC_KR $B$N regression test $BDI2C
("Soonmyung. Hong" <hong@lunaris.hanmesoft.co.kr> $B$5$sDs6!)
* EUC_JP $B$N regression test $B$K character_length(), position(),
substring(), octet_length() $BDI2C
* regress.sh $B$N SystemV $B$K$*$1$kHs8_49@-=$@5
* toupper(), tolower() $B$K 8bit $BJ8;z$,EO$k$HMn$A$k$3$H$,
$B$"$k$N$r=$@5
1998/3/25 PostgreSQL 6.3.1 $B%j%j!<%9!$MB PL2 $B$,<h$j9~$^$l$k
1998/3/10 PL2 $B$r%j%j!<%9
* EUC_JP, EUC_CN, MULE_INTERNAL $B$N regression test $B$rDI2C
(EUC_CN $B$N%G!<%?$O he@sra.co.jp $B$5$sDs6!)
* regexp $B$K$*$$$F!$isalpha $B$J$I$K unsigend char $B0J30$NCM$,
$BEO$i$J$$$h$&$K%,!<%I$r$+$1$k
* $B1Q8l$N%I%-%e%a%s%H$rDI2C
* MB $B$rDj5A$7$J$$>l9g$KH/@8$9$k%P%0$r=$@5
1998/3/1 PL1 $B$r%j%j!<%9
$B0J>e!%
$B@P0fC#IW
ishii@postgresql.org
$B"#$O$8$a$K
PostgreSQL $B$K$*$1$k%^%k%A%P%$%H%5%]!<%H$O0J2<$N$h$&$JFCD'$r;}$C$F$$$^$9!%
1. $B%^%k%A%P%$%HJ8;z$H$7$F!$F|K\8l!$Cf9q8l$J$I$N3F9q$N EUC$B!$Unicode$B!$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z$K$J$C$F$$$^$9$,!$
$B$3$l$OF|K\8l$J$I$r;HMQ$9$k:]$K$O2?$N%a%C%j%H$b$J$$$P$+$j$G$J$/!$>c32
$B$N860x$K$J$C$?$j!$LIKE$B8!:w$d@55,I=8=8!:w$G%$%s%G%C%/%9$,M-8z$K$J$i$J
$B$$$J$I$NLdBj$r0z$-5/$3$9$N$G!$L58z$K$7$F$*$/$3$H$r$*$9$9$a$7$^$9!%%m
$B%1!<%k%5%]!<%H$rL58z$K$9$k$?$a$K$O!$
--no-locale
$B%*%W%7%g%s$r;XDj$7$^$9!%
createdb $B$G$O0J2<$N%*%W%7%g%s$G%(%s%3!<%G%#%s%0$,;XDj$G$-$^$9!%
-E $B%(%s%3!<%G%#%s%0
--encoding=$B%(%s%3!<%G%#%s%0
create database $B$G$O0J2<$N%*%W%7%g%s$G%(%s%3!<%G%#%s%0$,;XDj$G$-$^$9!%
CREATE DATABASE dbanme WITH ENCODING = '$B%(%s%3!<%G%#%s%0';
LOCATION $B$rF1;~$K;XDj$9$k>l9g$O0J2<$N$h$&$K$J$j$^$9!%
CREATE DATABASE dbanme WITH LOCATION = 'path' ENCODING = '$B%(%s%3!<%G%#%s%0';
createdb/create database $B$G$O!$%(%s%3!<%G%#%s%0;XDj$r>JN,$7$?>l9g$O!$initdb
$B$G;XDj$7$?%(%s%3!<%G%#%s%0$,:NMQ$5$l$^$9!%$3$l$O!$initdb $B$,:n@.$9$k
$B%F%s%W%l!<%H%G!<%?%Y!<%9(template1)$B$N encoding $B%"%H%j%S%e!<%H$r7Q>5
$B$9$k$+$i$G$9!%
$B%G!<%?%Y!<%9$N%(%s%3!<%G%#%s%0$O!$psql -l$B!$psql $B$N \l $B$G;2>H$G$-$^$9!%
$ psql -l
List of databases
Database | Owner | Encoding
---------------+---------+---------------
euc_cn | t-ishii | EUC_CN
euc_jp | t-ishii | EUC_JP
euc_kr | t-ishii | EUC_KR
euc_tw | t-ishii | EUC_TW
mule_internal | t-ishii | MULE_INTERNAL
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B$9!%$3$N>l9g!$<+F0E*$K%P%C%/%(%s%I$G%(%s%3!<%G%#%s%0JQ49$,9T$o$l$^$9!%
$B%P%C%/%(%s%I$N%(%s%3!<%G%#%s%0 $B5vMF$5$l$k%U%m%s%H%(%s%I$N
$B%(%s%3!<%G%#%s%0
----------------------------------------------------------------
EUC_JP EUC_JP, SJIS, UNICODE
EUC_TW EUC_TW, BIG5, UNICODE
EUC_CN EUC_CN, UNICODE
EUC_KR EUC_KR, UNICODE
JOHAB JOHAB, UNICODE
LATIN1,3,4 LATIN1,3,4, UNICODE
LATIN2 LATIN2, WIN1250, UNICODE
LATIN5 LATIN5, WIN, ALT, UNICODE
LATIN6,7,8,9,10 LATIN6,7,8,9,10, UNICODE
ISO_8859_5,6,7,8 ISO_8859_5,6,7,8, UNICODE
WIN1256 WIN1256, UNICODE
TCVN TCVN, UNICODE
WIN874 WIN874, UNICODE
MULE_INTERNAL EUC_JP, SJIS, EUC_KR, EUC_CN,
EUC_TW, BIG5, LATIN1$B$+$i5,
WIN, ALT, WIN1250
UNICODE EUC_JP, SJIS, EUC_KR, UHC,
EUC_CN, GBK, EUC_TW, BIG5,
LATIN1$B$+$i10, ISO_8859_5$B$+$i8,
WIN, ALT, WIN1250, WIN1256,
TCVN, WIN874, JOHAB
----------------------------------------------------------------
$B%P%C%/%(%s%I$H%U%m%s%H%(%s%I$N%(%s%3!<%G%#%s%0$,0[$J$k>l9g!$$=$N$3$H
$B$r%P%C%/%(%s%I$KEA$($kI,MW$,$"$j$^$9!%$=$N$?$a$NJ}K!$,$$$/$D$+$"$j$^
$B$9!%
o psql $B$N \encoding $B%3%^%s%I$r;H$&J}K!
psql$B$G$O!$\encoding$B%3%^%s%I$r;H$C$FF0E*$K%U%m%s%H%(%s%IB&$NJ8;z%3!<
$B%I$r@ZBX$($k$3$H$,$G$-$^$9!%Nc:
\encoding SJIS
o libpq $B$N4X?t PQsetClientEncoding $B$r;H$&J}K!
7.0 $B$+$i?7$7$$ libpq $B4X?t PQsetClientEncoding $B$,DI2C$5$l$F$$$^$9!%
PQsetClientEncoding(PGconn *conn, const char *encoding)
$B$3$N4X?t$r;H$($P!$%3%M%/%7%g%sKh$K%(%s%3!<%G%#%s%0$r@ZBX$($k$3$H$,$G
$B$-$^$9!%8=:_$N%(%s%3!<%G%#%s%0$NLd$$9g$o$;$O
int PQclientEncoding(const PGconn *conn)
$B$G$9!%
o postgresql.conf $B$G@_Dj$9$kJ}K!
$B%U%m%s%H%(%s%I$N%G%U%)%k%H%(%s%3!<%G%#%s%0$r;XDj$9$k$K$O!$
postgresql.conf $B$N client_encoding $B$r;XDj$7$^$9!%;XDjNc:
client_encoding = SJIS
o $B4D6-JQ?t PGCLIENTENCODING $B$r;H$&J}K!
(1) postmaster $B5/F0;~$K4D6-JQ?t$r@_Dj$9$kJ}K!
$B4D6-JQ?t PGCLIENTENCODING $B$r@_Dj$9$k$3$H$K$h$j!$ postgresql.conf $B$G
$B%(%s%3!<%G%#%s%0$r;XDj$9$k$N$HF1$88z2L$,F@$i$l$^$9!%$?$@$7!$$3$l$ONr
$B;KE*7P0^$+$i;D$5$l$F$$$k5!G=$G!$:#8e$O$3$N5!G=$rMxMQ$7$J$$$3$H$r$*$9
$B$9$a$7$^$9!%@_DjNc:
export PGCLIENTENCODING=SJIS postmaster -S
(2) $B%/%i%$%"%s%H!$%U%m%s%H%(%s%IKh$K%(%s%3!<%G%#%s%0$r@_Dj$7$?$$>l9g
$B$=$N%U%m%s%H%(%s%I($B$?$H$($P psql)$B$r5/F0$9$kA0$K4D6-JQ?t
PGCLIENTENCODING $B$r@_Dj$7$^$9!%
o set client_encoding $B%3%^%s%I$r;H$&J}K!
SET CLIENT_ENCODING SQL$B%3%^%s%I$r;H$C$FF0E*$K%U%m%s%H%(%s%I$N%(%s%3!<
$B%G%#%s%0$rJQ99$G$-$^$9!%Nc:
SET CLIENT_ENCODING TO SJIS;
$B"#8=:_@_Dj$5$l$F$$$k%U%m%s%H%(%s%IB&$N%(%s%3!<%G%#%s%0$rD4$Y$k
$B8=:_@_Dj$5$l$F$$$k%U%m%s%H%(%s%IB&$N%(%s%3!<%G%#%s%0$O
show client_encoding;
$B$G;2>H$G$-$^$9($B>.J8;z$GI=<($5$l$^$9)$B!%
$B"#%G%U%)%k%H$N%(%s%3!<%G%#%s%0$X$NI|5"
SQL$B%3%^%s%I:
RESET CLIENT_ENCODING;
$B$O!$%G%U%)%k%H$N%U%m%s%H%(%s%I%(%s%3!<%G%#%s%0@_Dj$KI|5"$5$;$^$9!%
postmaster$B$rN)$A>e$2$k$H$-$K postgresql.conf $B$N client_encoding $B$d4D
$B6-JQ?t PGCLIENTENCODING $B$,@_Dj$5$l$F$$$k$H$=$N%(%s%3!<%G%#%s%0$K!$$=
$B$&$G$J$1$l$P%G!<%?%Y!<%9$N%(%s%3!<%G%#%s%0$HF1$8$K$J$j$^$9!%
$B"#L@<(E*$J%(%s%3!<%G%#%s%0JQ49
7.2$B$G$O!$convert$B$H$$$&4X?t$r;H$$!$L@<(E*$J%(%s%3!<%G%#%s%0JQ49$,$G$-
$B$^$9!%
convert(string text, [src_encoding name,] dest_encoding name)
$B$3$3$Gsrc_encoding$B$Otext$B$N%(%s%3!<%G%#%s%0L>$G$9!%>JN,$9$k$H!$%G!<%?
$B%Y!<%9%(%s%3!<%G%#%s%0L>$HF1$8$G$"$k$H8+$J$5$l$^$9!%dest_encoding$B$O!$
$BJQ498e$N%(%s%3!<%G%#%s%0L>$G$9!%
$BNc$r<($7$^$9!%
SELECT convert(text, EUC_JP) FROM unicode_tbl;
$B$O!$Unicode$B$N%F!<%V%kunicode_tbl$B$Ntext$BNs$rEUC_JP$B$KJQ49$7$FJV$7$^$9!%
7.3$B$G$O$5$i$KSQL$BI8=`$NCONVERT$B4X?t$,;H$($^$9!%SQL$BI8=`$NCONVERT$B$O
PostgreSQL$B$NCONVERT$B$H5!G=$O$[$H$s$IF1$8$G$9$,!$8F$S=P$77A<0$,0[$j$^
$B$9!%
SELECT convert(text using euc_jp_to_utf_8) FROM unicode_tbl;
"using" $B$N8e$N0z?t$O!V%3%s%P!<%8%g%sL>!W$G$9!%$3$NNc$G$O!$EUC_JP $B$+
$B$i UTF-8 $B$KJQ49$9$k%3%s%P!<%8%g%s$r;XDj$7$F$$$^$9!%Dj5A:Q$N%3%s%P!<
$B%8%g%s$K$D$$$F$O!$%f!<%6!<%:%,%$%I$N "String Functions and
Operators" $B$NI="Built-in Conversions" $B$r8+$F$/$@$5$$!%
$B"#%(%s%3!<%G%#%s%0JQ49ITG=$N>l9g$N=hM}
$B%P%C%/%(%s%IB&$N%(%s%3!<%G%#%s%0$H%U%m%s%H%(%s%IB&$N%(%s%3!<%G%#%s%0
$B$,$$$D$bAj8_JQ49$G$-$k$H$O8B$j$^$;$s!%6KC<$JOC!$%P%C%/%(%s%IB&$,
EUC_JP $B$J$N$K!$%U%m%s%H%(%s%IB&$, EUC_KR $B$@$C$?$i$I$&$J$k$G$7$g$&!%
$B$3$N>l9g PostgreSQL $B$OJQ49$G$-$J$$%3!<%I$r 16$B?JI=8=$KJQ49$7$^$9!%
$B$?$H$($P!$"(bdae)" $B$N$h$&$K!%$J$*!$$3$N 16$B?JI=8=$O mule
internal code $B$N%3!<%I$G$"$k$3$H$KCm0U$7$F2<$5$$!%$3$l$O!$D>@\%U%m%s
$B%H%(%s%I <--> $B%P%C%/%(%s%I$N%(%s%3!<%G%#%s%0$rJQ49$9$k$N$G$O$J$/!$0l
$BEYFbItI=8=$G$"$k mule internal code $B$r7PM3$7$F$$$k$?$a$G$9!%
$B$J$*!$Unicode$B$H$=$l0J30$N%(%s%3!<%G%#%s%0$NJQ49$@$1$ONc30$G!$NOTICE
$B%a%C%;!<%8$,I=<($5$l!$JQ49ITG=$NJ8;z$OL5;k$5$l$^$9!%
$B"#%G%U%)%k%H%3%s%P!<%8%g%s
$B%G%U%)%k%H%3%s%P!<%8%g%s$O!$%P%C%/%(%s%I$H%U%m%s%H%(%s%I$H$N4V$N%(%s
$B%3!<%G%#%s%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j%s%0%j%9%H
$B$N%a%s%P$NJ}$+$i%"%I%P%$%9$rD:$-$^$7$?!%$3$3$K46<U$7$^$9!%
$B$^$?!$SJIS $BBP1~$K$D$$$F$O!$;T@n@$B$*CcBg$5$s$N%Q%C%A$r;29M$K$5$;$F$$
$B$?$@$-$^$7$?!%
o SJIS$B%f!<%6Dj5AJ8;z (UDC) $B$r$I$&07$&$+$H8@$&$3$H$K$D$$$FCf>r$5$s
(nak@email.com)$B$+$iLdBjDs5/$H>\:Y$J2r@b$rD:$-$^$7$?!%
$B"#Unicode$B$H$=$l0J30$N%(%s%3!<%G%#%s%0$H$NAj8_JQ49$K$D$$$F
PostgreSQL 7.1$B$+$iUnicode$B$H$=$l0J30$N%(%s%3!<%G%#%s%0$H$NAj8_JQ49$,
$B2DG=$K$J$j$^$7$?!%$3$NJQ49$O$4$/0lIt$NJ8;z%3!<%I(ISO 8859-1)$B$r$N$>$-!$
$B%m%8%C%/$K$h$kJQ49$,$G$-$J$$$?$a!$JQ49$N:]$K$O%F!<%V%k$,I,MW$K$J$j$^
$B$9!%PostgreSQL$B$N<BAu$G$O!$Unicode$BJQ49%F!<%V%k$O Unicode organization
$B$,Ds6!$9$k$b$N$r;HMQ!$$3$l$rPerl$B%W%m%0%i%`$GC$B8@8l$N%F!<%V%k$KJQ49$7
$B$F:n@.$7$F$$$^$9(Perl$B%W%m%0%i%`$ONARITA Tomio$B;a:n@.$Nlv$B%P!<%8%g%s
4.3.6 $B$KIUB0$9$k$b$N$r2~B$$N>e!$MxMQ$7$F$$$^$9)$B!%Unicode
organization$B$NDs6!$9$kJQ49%F!<%V%k$O:FG[I[$,5v2D$5$l$F$$$J$$$?$a!$
PostgreSQL$B$N%=!<%9%3!<%I$K$O4^$^$l$F$$$^$;$s!%0J2<!$;HMQ$7$?JQ49%F!<
$B%V%k$rNs5s$7$^$9!%
$B%(%s%3!<%G%#%s%0 $BJQ49%F!<%V%k
============================================================
ISO 8859-1 $B$J$7
ISO 8859-2 8859-2.TXT
ISO 8859-3 8859-3.TXT
ISO 8859-4 8859-4.TXT
ISO 8859-5 8859-5.TXT
ISO 8859-6 8859-6.TXT
ISO 8859-7 8859-7.TXT
ISO 8859-8 8859-8.TXT
ISO 8859-9 8859-9.TXT
ISO 8859-10 8859-10.TXT
ISO 8859-13 8859-13.TXT
ISO 8859-14 8859-14.TXT
ISO 8859-15 8859-15.TXT
ISO 8859-16 8859-16.TXT
EUC_JP JIS0201.TXT, JIS0208.TXT, JIS0212.TXT,
CP932.TXT, sjis.map
SJIS CP932.TXT
EUC_CN GB2312.TXT
GBK CP936.TXT
EUC_KR KSX1001.TXT
UHC CP949.TXT
JOHAB JOHAB.TXT
EUC_TW CNS11643.TXT
Big5 BIG5.TXT
WIN1256 CP1256.TXT
TCVN CP1258.TXT
WIN874 CP874.TXT
============================================================
$B<U<-!'
o $BFA2H@$B;06(1?M"%5!<%S%9$5$s$+$i!$CP932.TXT$B$h$j@8@.$7$?SJIS$BMQ$NJQ49%F!<
$B%V%k$rDs6!$7$F$$$?$@$-$^$7$?!%$3$l$K$h$j!$IBM $B3HD%J8;zNN0h (SJIS
115$B!A120 $B6h), NEC $BA*Dj IBM $B3HD%J8;zNN0h (SJIS 89$B!A92 $B6h)$B$KBP1~$9$k
$B$3$H$,$G$-$k$h$&$K$J$j$^$7$?!%
$B;29M1$B!'
Pavel Behal$B;a$K$h$jDs6!$5$l$?WIN1250$B%5%]!<%H$G$9$,!$Windows$B4D6-$G$N
$BMxMQ$N;EJ}$K$D$$$F;29M$K$J$k%I%-%e%a%s%H$,IUB0$7$F$$$k$N$G!$$3$3$KE:
$BIU$7$F$*$-$^$9!%
-------------------------------------------------------------------
Version: 0.91 for PgSQL 6.5
Author: Pavel Behal
Revised by: Tatsuo Ishii
Email: behal@opf.slu.cz
Licence: The Same as PostgreSQL
Sorry for my Eglish and C code, I'm not native :-)
!!!!!!!!!!!!!!!!!!!!!!!!! NO WARRANTY !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Instalation:
------------
1) Change three affected files in source directories
(I don't have time to create proper patch diffs, I don't know how)
[PostgreSQL 6.5.1$B$G$O$3$N%9%F%C%W$OI,MW$"$j$^$;$s!%-- $B@P0f]
2) Compile with enabled locale and multibyte set to LATIN2
3) Setup properly your instalation, do not forget to create locale
variables in your profile (environment). Ex. (may not be exactly true):
LC_ALL=cs_CZ.ISO8859-2
LC_COLLATE=cs_CZ.ISO8859-2
LC_CTYPE=cs_CZ.ISO8859-2
LC_MONETARY=cs_CZ.ISO8859-2
LC_NUMERIC=cs_CZ.ISO8859-2
LC_TIME=cs_CZ.ISO8859-2
4) You have to start the postmaster with locales set!
5) Try it with Czech language, it have to sort
5) Install ODBC driver for PgSQL into your M$ Windows
6) Setup properly your data source. Include this line in your ODBC
configuration dialog in field "Connect Settings:" :
SET CLIENT_ENCODING = 'WIN1250';
7) Now try it again, but in Windows with ODBC.
Description:
------------
- Depends on proper system locales, tested with RH6.0 and Slackware 3.6,
with cs_CZ.iso8859-2 loacle
- Never try to set-up server multibyte database encoding to WIN1250,
always use LATIN2 instead. There is not WIN1250 locale in Unix
- WIN1250 encoding is useable only for M$W ODBC clients. The characters are
on thy fly re-coded, to be displayed and stored back properly
Important:
----------
- it reorders your sort order depending on your LC_... setting, so don't be
confused with regression tests, they don't use locale
- "ch" is corectly sorted only in some newer locales (Ex. RH6.0)
- you have to insert money as '162,50' (with comma in aphostrophes!)
- not tested properly
-------------------------------------------------------------------
$B;29M2$B!'SJIS$B%f!<%6Dj5AJ8;z (UDC) $B$r$I$&07$&$+$H8@$&$3$H$K$D$$$FCf>r$5$s
(nak@email.com)$B$+$i$$$?$@$$$?LdBjDs5/$H2r@b$G$9!%
-------------------------- $B0zMQ3+;O ----------------------------------
---
1. SJIS $B%3!<%I$NHO0O
1 $B%P%$%HL\ 0x81 - 0x9F$B!$0xE0 - 0xFC
2 $B%P%$%HL\ 0x40 - 0x7E$B!$0x80 - 0xFC
$B$$$o$f$k!V30;zNN0h!W$NHO0O:
- X0208 $B6&DL<+M3NN0h
|--------------------
| 85 $B6h 0xEB40 $B!A
|...
|--------------------
| 89 $B6h 0xED40 $B!A ; 89$B!A92 $B6h$O
|... ; $B!VNEC $BA*Dj IBM $B3HD%J8;zNN0h!W
|-------------------- ; $B$H8F$P$l$k
| 93 $B6h 0xEF40 $B!A
| 94 $B6h 0xEF9F $B!A 0xEFFC
- $B%f!<%6Dj5AJ8;zNN0h
|--------------------
| 95 $B6h 0xF040 $B!A ; 95$B!A104 $B6h
|... ; $B!V%f!<%6Dj5AJ8;zNN0h A$B!W($B2>>N)
|--------------------
|105 $B6h 0xF540 $B!A ; 105$B!A114 $B6h
|... ; $B!V%f!<%6Dj5AJ8;zNN0h B$B!W($B2>>N)
|--------------------
|115 $B6h 0xFA40 $B!A ; 115$B!A120 $B6h$O0lHL$K
|... ; $B!VIBM $B3HD%J8;zNN0h!W
|120 $B6h ... ; $B$H8F$P$l$k
|--------------------
---
2. i-mode $BC<Kv$,;H$C$F$$$k?^7AJ8;z%3!<%I$NHO0O
0xF89F - 0xF8FC (112 $B6h)
0xF940 - 0xF949 (113 $B6h)
0xF972 - 0xF97E (113 $B6h)
0xF980 - 0xF990 (113 $B6h)
0xF9B0 (114 $B6h)
---
3. $B0lHLE*$J EUC $BF|K\8l%3!<%I$NDj5A
G0 : [0x21-0x7E] ; $B$$$o$f$k JIS ROMAN
G1 : [0xA1-0xFE] [0xA1-0xFE] ; JIS X 0208
G2 : 0x8E [0xA1-0xDF] ; JIS X 0201 $B%+%J
G3 : 0x8F [0xA1-0xFE] [0x21-0x7E] ; JIS X 0212 $BJd=u4A;z
---
[$BLdBjE@]
SJIS 95$B!A120 $B6h$O JIS X0208 $B$K3:Ev$9$kNN0h$,B8:_$7$J$$
$B$?$a!$$3$NNN0h$N EUC - SJIS $BJ8;z%3!<%IJQ49$O3F%Y%s%@$K
$B$h$C$F0[$J$k$N$G$O$J$$$+!$$H$$$&$N$,@P0fMM$+$i$N$4;XE&
$B$G$7$?!%
---
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?d>) EUC$B!&%7%U%H
JIS $B%3!<%IJQ49;EMM!W$K$b$H$E$/$H=q$$$F$"$j!$Solaris 2.6 $B$+$iF3F~
$B$7$F$$$k$N$@$=$&$G!$;d$+$i8+$l$P;v<B>e$NI8=`$H9M$($F$bIT<+A3$G$O
$B$J$$$H46$8$^$9!%
$B$J$*!$>/$J$/$H$b 1996 $BG/Ev;~$K$*$$$F$O!$Oracle $B$d Sybase $B$O
SJIS $B$N%f!<%6Dj5A/$B%Y%s%@Dj5AJ8;zNN0h$r EUC $B$KJQ49$9$k:]!$H=JLIT
$B2DG=J8;z$H$7$F07$C$F$$$k$i$7$$$H$$$&$3$H$bJdB-$7$F$*$-$^$9!%
---
[$B;29M;qNA]
// URL $B$,D9$$$N$G!$ESCf$G@Z$l$J$$$H$$$$$N$G$9$,...
-$B!VF|K\8l EUC$B!&%7%U%H JIS $B%3!<%IJQ49;EMM$H%3!<%I7O<BBVD4::!W
1966, OSF $BF|K\%Y%s%@6(5D2q
http://www.opengroup.or.jp/jvc/cde/sjis-euc.html
-$B!VJ8;z%3!<%IJQ495,B'!W
Solaris 7$B!$JFP $B%f!<%6!<%:%,%$%I
http://docs.sun.com/ab2/coll.139.3/JFPUG/@Ab2PageView/11683?Ab2Lang=ja&Ab2Enc=euc-jp
-$B!VF|K\8lJ8;z%3!<%I!W
Solaris 7$B!$JFP $B%f!<%6!<%:%,%$%I
http://docs.sun.com/ab2/coll.139.3/JFPUG/@Ab2PageView/879;td=5?Ab2Lang=ja&Ab2Enc=euc-jp
// $BFf$N!V1$B!A20 $B6h!W$N5-=R$O$3$3$+$i$-$F$$$^$9!%
---
-------------------------- $B0zMQ$3$3$^$G ---------------------------------
$B2~DjMzNr!'
2002/10/21
* $B%^%k%A%P%$%HBP1~$,%*%W%7%g%s$G$O$J$/!$8GDj$GI,$:AH$_9~$^$l$k
$B$h$&$K$J$j$^$7$?!%
* CREATE CONVERSION/DROP CONVERSION$B$NDI2C!%$3$l$K$H$b$J$$!$%(
$B%s%3!<%G%#%s%0JQ494X?t$,%m!<%@%V%k4X?t$K$J$j!$%P%C%/%(%s%I$N
$B%m!<%I%b%8%e!<%k%5%$%:$,7.2$B$h$j$b>.$5$/$J$C$F$$$^$9!%$^$?!$
SQL$BI8=`$NCONVERT$B4X?t$rDI2C$7$^$7$?!%
* $B$$$/$D$+%(%s%3!<%G%#%s%0$,DI2C$5$l$F$$$^$9!%
* $B0J>e!$7.3$B$KH?1G$5$l$^$9!%
2001/10/01
* CONVERT$B$NDI2C!%lpad/rpad/trim/btrim/ltrim/rtrim/translate$B$N
$B%^%k%A%P%$%HBP1~DI2C!%char/varchar$B$G%P%$%H?t$G$O$J$/!$J8;z?t
$B$G%5%$%:$rDj5A$9$k$h$&$KJQ99!%0J>e!$7.2$B$KH?1G$5$l$^$9!%
2001/2/15
* $BFA2H@$B;06(1?M"%5!<%S%9$5$s$+$i!$CP932.TXT$B$h$j@8@.$7$?SJIS$BMQ$N
$BJQ49%F!<%V%k$rDs6!$7$F$$$?$@$-$^$7$?!%7.1$B$KH?1G$5$l$^$9!%
2001/1/6
* UNICODE$B$HB>$N%(%s%3!<%G%#%s%0$H$NAj8_JQ495!G=$rDI2C!%
* 7.1$B$KH?1G$5$l$^$9!%
2000/5/20
* NEC $BA*Dj IBM $B4A;zBP1~$rDI2C$7$^$7$?!%$3$l$O $BFA2H@$B;06(1?M"%5!<%S%9
$B$5$s$+$i$N contribute $B$G$9!%
* $B$3$l$i$O!$7.0.1 $B$KH?1G$5$l$^$9!%
2000/3/22
* PQsetClientEncoding, PQclientEncoding $B$rlibpq $B4X?t$KDI2C!$
$B%3%M%/%7%g%sKh$K%(%s%3!<%G%#%s%0$rJQ992DG=$K!%
* SJIS $B%f!<%6Dj5AJ8;z (UDC) $B$X$NBP1~
* ./configure --with-mb=EUC_JP $B$+$i
./configure --enable-multibyte=EUC_JP $B$KJQ99
* SQL_ASCII $B$N regression test $BDI2C
* $B$3$l$i$O 7.0 $B$KH?1G$5$l$^$9!%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%s%3!<%G%#%s%0$H$7$FMxMQ$G$-$k$h
$B$&$K$J$j$^$7$?!%$3$N>l9g!$%P%C%/%(%s%IB&$N%(%s%3!<%G%#%s%0$O
EUC_TW $B$^$?$O MULE_INTERNAL $B$H$7$^$9!%
* EUC_TW $B$N regression test $B%1!<%9$rDI2C
(contributed by Jonah Kuo <jonahkuo@mail.ttn.com.tw>)
1998/12/16 $BK\%I%-%e%a%s%H=$@5(6.4.2 $B$KH?1G:Q)$B!%
* Makefile.custom $B$G MB=EUC_JP $B$J$I$H@_Dj$9$kJ}K!$O 6.4 $B0J9_
$B%5%]!<%H$5$l$F$$$J$$$N$G:o=|$7$?!%
* $BJ8;z%3!<%I $B"* $B%(%s%3!<%G%#%s%0!$%/%i%$%"%s%H"*%U%m%s%H%(%s%I
$B%5!<%P"*%P%C%/%(%s%I $B$K$=$l$>$l8l6g$r=$@5!%
1998/12/15 6.4 $B8~$1%P%0=$@5%Q%C%A%j%j!<%9(6.4.2 $B$KH?1G:Q)$B!%
* SQL_ASCII $B%5%]!<%H$N%P%0=$@5
1998/11/21 6.4 $B8~$1%P%0=$@5%Q%C%A%j%j!<%9(6.4.2 $B$KH?1G:Q)$B!%
* BINARY CURSOR $B$NLdBj$r=$@5
* pg_dumpall $B$N%P%0=$@5
1998/11/5 6.4 $B%j%j!<%9!%
* pg_database $B$N encoding $B%+%i%`$, MB $B$,M-8z$G$J$$$H$-$K$b
$BDI2C$5$l$k$h$&$K$J$C$?!%$=$N$?$a!$MB $B$,M-8z$G$J$$$H$-$K$O!$
ASCII $B$N%(%s%3!<%G%#%s%0$rI=$9 SQL_ASCII $B$r?7$7$$%(%s%3!<%G%#%s%0
$B$H$7$FDI2C$7$?!%$3$l$K$H$b$J$$!$%(%s%3!<%G%#%s%0L>$KBP1~$9$k
$B%(%s%3!<%G%#%s%0ID$B$, SQL_ASCII $B$r 0 $B$H$9$kHV9f$KJQ99$K$J$C$?!%
1998/7/22 6.4 $B&A8~$1$K%Q%C%A$r%j%j!<%9!%
* initdb/createdb/create database $B$G%P%C%/%(%s%IB&$N
$B%(%s%3!<%G%#%s%0$r@_Dj$-$k5!G=<BAu!%$3$N$?$a!$%7%9%F%`%+%?%m
$B%0$N pg_database $B$K?7$7$$%+%i%` encoding $B$rDI2C(MB$B$,M-8z$J;~$@$1)
* copy $B$, PGCLIENTENCODING $B$KBP1~
* SQL92 $B$N "SET NAMES" $B$r%5%]!<%H(MB$B$,M-8z$J;~$@$1)
* LATIN2-5 $B$r%5%]!<%H
* regression test $B$K unicode $B$N%F%9%H%1!<%9$rDI2C
* MB $B@lMQ$N regression $B%F%9%H%G%#%l%/%H%j test/mb $B$rDI2C
* $B%=!<%9%U%!%$%k$NCV$->l=j$rBgI}8+D>$7!%MB $B4X78$O
include/mb, backend/utils/mb $B$KCV$/$h$&$K$7$?
1998/5/25 $B%P%0=$@5(mb_b3.patch $B$H$7$F pgsql-jp ML $B$K%j%j!<%9!$
$BK\2H$G$O 6.4 snapshot $B$K<h$j9~$^$l$kM=Dj)
1998/5/18 $B5!G=DI2C!?%P%0=$@5(mb_b2.patch $B$H$7$F pgsql-jp ML $B$K%j%j!<%9!$
$BK\2H$G$O 6.4 snapshot $B$K<h$j9~$^$l$kM=Dj)
* $B4D6-JQ?t PGCLIENTENCODING $B$N%5%]!<%H!%%U%m%s%H%(%s%IB&$N
$B%(%s%3!<%G%#%s%0$r;XDj$9$k!%8=:_!$SJIS, EUC_*, MULE_INTERNAL,
LATIN1 $B$,;XDj$G$-$k!%$^$?!$
set client_encoding to 'sjis';
$B$G$b2DG=
* 8bit $BJ8;z$,EO$k$HLdBj$,5/$-$k2U=j$K$G$-$k$@$1BP1~
1998/4/21 $B5!G=DI2C!?%P%0=$@5(mb_b1.patch $B$H$7$F pgsql-jp ML $B$K%j%j!<%9!$
$BK\2H$G$O 6.4 snapshot $B$K<h$j9~$^$l$F$$$k)
* character_length(), position(), substring() $B$N%^%k%A%P%$%H
$BBP1~
* octet_length() $BDI2C $B"* initdb $B$N$d$jD>$7I,MW
* configure $B$N%*%W%7%g%s$K MB $B%5%]!<%HDI2C
(ex. configure --with-mb=EUC_JP)
* EUC_KR $B$N regression test $BDI2C
("Soonmyung. Hong" <hong@lunaris.hanmesoft.co.kr> $B$5$sDs6!)
* EUC_JP $B$N regression test $B$K character_length(), position(),
substring(), octet_length() $BDI2C
* regress.sh $B$N SystemV $B$K$*$1$kHs8_49@-=$@5
* toupper(), tolower() $B$K 8bit $BJ8;z$,EO$k$HMn$A$k$3$H$,
$B$"$k$N$r=$@5
1998/3/25 PostgreSQL 6.3.1 $B%j%j!<%9!$MB PL2 $B$,<h$j9~$^$l$k
1998/3/10 PL2 $B$r%j%j!<%9
* EUC_JP, EUC_CN, MULE_INTERNAL $B$N regression test $B$rDI2C
(EUC_CN $B$N%G!<%?$O he@sra.co.jp $B$5$sDs6!)
* regexp $B$K$*$$$F!$isalpha $B$J$I$K unsigend char $B0J30$NCM$,
$BEO$i$J$$$h$&$K%,!<%I$r$+$1$k
* $B1Q8l$N%I%-%e%a%s%H$rDI2C
* MB $B$rDj5A$7$J$$>l9g$KH/@8$9$k%P%0$r=$@5
1998/3/1 PL1 $B$r%j%j!<%9
$B0J>e!%