2011-02-14 09:06:41 +08:00
|
|
|
|
CREATE EXTENSION unaccent;
|
2009-08-19 00:00:50 +08:00
|
|
|
|
-- must have a UTF8 database
|
|
|
|
|
SELECT getdatabaseencoding();
|
|
|
|
|
getdatabaseencoding
|
|
|
|
|
---------------------
|
|
|
|
|
UTF8
|
|
|
|
|
(1 row)
|
|
|
|
|
|
2009-08-18 18:34:39 +08:00
|
|
|
|
SET client_encoding TO 'KOI8';
|
|
|
|
|
SELECT unaccent('foobar');
|
|
|
|
|
unaccent
|
|
|
|
|
----------
|
|
|
|
|
foobar
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SELECT unaccent('<27><><EFBFBD><EFBFBD>');
|
|
|
|
|
unaccent
|
|
|
|
|
----------
|
|
|
|
|
<20><><EFBFBD><EFBFBD>
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SELECT unaccent('<27><><EFBFBD><EFBFBD>');
|
|
|
|
|
unaccent
|
|
|
|
|
----------
|
|
|
|
|
<20><><EFBFBD><EFBFBD>
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SELECT unaccent('unaccent', 'foobar');
|
|
|
|
|
unaccent
|
|
|
|
|
----------
|
|
|
|
|
foobar
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SELECT unaccent('unaccent', '<27><><EFBFBD><EFBFBD>');
|
|
|
|
|
unaccent
|
|
|
|
|
----------
|
|
|
|
|
<20><><EFBFBD><EFBFBD>
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SELECT unaccent('unaccent', '<27><><EFBFBD><EFBFBD>');
|
|
|
|
|
unaccent
|
|
|
|
|
----------
|
|
|
|
|
<20><><EFBFBD><EFBFBD>
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SELECT ts_lexize('unaccent', 'foobar');
|
|
|
|
|
ts_lexize
|
|
|
|
|
-----------
|
|
|
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SELECT ts_lexize('unaccent', '<27><><EFBFBD><EFBFBD>');
|
|
|
|
|
ts_lexize
|
|
|
|
|
-----------
|
|
|
|
|
{<7B><><EFBFBD><EFBFBD>}
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SELECT ts_lexize('unaccent', '<27><><EFBFBD><EFBFBD>');
|
|
|
|
|
ts_lexize
|
|
|
|
|
-----------
|
|
|
|
|
{<7B><><EFBFBD><EFBFBD>}
|
|
|
|
|
(1 row)
|
|
|
|
|
|