This repository was archived by the owner on Aug 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfunction.uaccent.pgsql
More file actions
74 lines (74 loc) · 2.44 KB
/
Copy pathfunction.uaccent.pgsql
File metadata and controls
74 lines (74 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
CREATE OR REPLACE FUNCTION uaccent(text) RETURNS text AS '
DECLARE
str ALIAS FOR $1;
BEGIN
str := replace(str,''Š'',''S'');
str := replace(str,''š'',''s'');
str := replace(str,''Ð'',''Dj'');
str := replace(str,''Ž'',''Z'');
str := replace(str,''ž'',''z'');
str := replace(str,''À'',''A'');
str := replace(str,''Á'',''A'');
str := replace(str,''Â'',''A'');
str := replace(str,''Ã'',''A'');
str := replace(str,''Ä'',''A'');
str := replace(str,''Å'',''A'');
str := replace(str,''Æ'',''A'');
str := replace(str,''Ç'',''C'');
str := replace(str,''È'',''E'');
str := replace(str,''É'',''E'');
str := replace(str,''Ê'',''E'');
str := replace(str,''Ë'',''E'');
str := replace(str,''Ì'',''I'');
str := replace(str,''Í'',''I'');
str := replace(str,''Î'',''I'');
str := replace(str,''Ï'',''I'');
str := replace(str,''Ñ'',''N'');
str := replace(str,''Ò'',''O'');
str := replace(str,''Ó'',''O'');
str := replace(str,''Ô'',''O'');
str := replace(str,''Õ'',''O'');
str := replace(str,''Ö'',''O'');
str := replace(str,''Ø'',''O'');
str := replace(str,''Ù'',''U'');
str := replace(str,''Ú'',''U'');
str := replace(str,''Û'',''U'');
str := replace(str,''Ü'',''U'');
str := replace(str,''Ý'',''Y'');
str := replace(str,''Þ'',''B'');
str := replace(str,''ß'',''Ss'');
str := replace(str,''à'',''a'');
str := replace(str,''á'',''a'');
str := replace(str,''â'',''a'');
str := replace(str,''ã'',''a'');
str := replace(str,''ä'',''a'');
str := replace(str,''å'',''a'');
str := replace(str,''æ'',''a'');
str := replace(str,''ç'',''c'');
str := replace(str,''è'',''e'');
str := replace(str,''é'',''e'');
str := replace(str,''ê'',''e'');
str := replace(str,''ë'',''e'');
str := replace(str,''ì'',''i'');
str := replace(str,''í'',''i'');
str := replace(str,''î'',''i'');
str := replace(str,''ï'',''i'');
str := replace(str,''ð'',''o'');
str := replace(str,''ñ'',''n'');
str := replace(str,''ò'',''o'');
str := replace(str,''ó'',''o'');
str := replace(str,''ô'',''o'');
str := replace(str,''õ'',''o'');
str := replace(str,''ö'',''o'');
str := replace(str,''ø'',''o'');
str := replace(str,''ù'',''u'');
str := replace(str,''ú'',''u'');
str := replace(str,''û'',''u'');
str := replace(str,''ý'',''y'');
str := replace(str,''ý'',''y'');
str := replace(str,''þ'',''b'');
str := replace(str,''ÿ'',''y'');
str := replace(str,''ƒ'',''f'');
RETURN str;
END;
' LANGUAGE 'plpgsql' IMMUTABLE;