line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# bibliography package for Perl |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# UTF8 character set. |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Peter Tandler |
7
|
|
|
|
|
|
|
# Dec 1 2004
|
8
|
|
|
|
|
|
|
#
|
9
|
|
|
|
|
|
|
# adapted from bp_cs_88591 |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
package bp_cs_utf8;
|
12
|
2
|
|
|
2
|
|
59
|
use 5.008; # for Unicode / utf-8 support |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
735
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
###### |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
$bib'charsets{'utf8', 'i_name'} = 'utf8'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
$bib'charsets{'utf8', 'tocanon'} = "bp_cs_utf8'tocanon"; |
19
|
|
|
|
|
|
|
$bib'charsets{'utf8', 'fromcanon'} = "bp_cs_utf8'fromcanon"; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
$bib'charsets{'utf8', 'toesc'} = "[\000]"; # we'd prefer to never call it |
22
|
|
|
|
|
|
|
$bib'charsets{'utf8', 'fromesc'} = "${bib'cs_ext}|${bib'cs_meta}"; |
23
|
|
|
|
|
|
|
###### |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
##################### |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub tocanon { |
29
|
0
|
|
|
0
|
|
0
|
$_[0]; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
###### |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub fromcanon { |
35
|
6
|
|
|
6
|
|
17
|
local($_, $protect) = @_; |
36
|
6
|
|
|
|
|
16
|
local($repl, $unicode, $can); |
37
|
|
|
|
|
|
|
|
38
|
6
|
50
|
|
|
|
46
|
return $_ unless /$bib'cs_escape/o; |
39
|
|
|
|
|
|
|
|
40
|
6
|
|
|
|
|
48
|
1 while s/${bib'cs_ext}(....)/\X{$1}/g; |
41
|
|
|
|
|
|
|
|
42
|
6
|
|
|
|
|
52
|
while (/${bib'cs_meta}(....)/) { |
43
|
12
|
|
|
|
|
30
|
$repl = $1; |
44
|
12
|
|
|
|
|
48
|
$can = &bib'meta_approx($repl); |
45
|
12
|
50
|
33
|
|
|
235
|
defined $can && s/$bib'cs_meta$repl/$can/g && next; |
46
|
0
|
|
|
|
|
0
|
&bib'gotwarn("Can't convert ".&bib'meta_name($repl)." to UTF8"); |
47
|
0
|
|
|
|
|
0
|
s/${bib'cs_meta}$repl//g; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
6
|
|
|
|
|
38
|
$_; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
####################### |
54
|
|
|
|
|
|
|
# end of package |
55
|
|
|
|
|
|
|
####################### |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |