Commit | Line | Data |
---|---|---|
351625bd SP |
1 | |
2 | require 5; | |
3 | use 5.008; | |
4 | ## Anything before 5.8.0 is GIMPY! | |
5 | ## This module is to be use()'d only by Pod::Simple::Transcode | |
6 | ||
7 | package Pod::Simple::TranscodeSmart; | |
8 | use strict; | |
9 | use Pod::Simple; | |
10 | require Encode; | |
a242eeb4 | 11 | use vars qw($VERSION ); |
6c309775 | 12 | $VERSION = '3.35'; |
351625bd SP |
13 | |
14 | sub is_dumb {0} | |
15 | sub is_smart {1} | |
16 | ||
17 | sub all_encodings { | |
18 | return Encode::->encodings(':all'); | |
19 | } | |
20 | ||
21 | sub encoding_is_available { | |
22 | return Encode::resolve_alias($_[1]); | |
23 | } | |
24 | ||
25 | sub encmodver { | |
26 | return "Encode.pm v" .($Encode::VERSION || '?'); | |
27 | } | |
28 | ||
29 | sub make_transcoder { | |
9dd0d393 | 30 | my $e = Encode::find_encoding($_[1]); |
351625bd SP |
31 | die "WHAT ENCODING!?!?" unless $e; |
32 | my $x; | |
33 | return sub { | |
34 | foreach $x (@_) { | |
9dd0d393 | 35 | $x = $e->decode($x) unless Encode::is_utf8($x); |
351625bd SP |
36 | } |
37 | return; | |
38 | }; | |
39 | } | |
40 | ||
41 | ||
42 | 1; | |
43 | ||
44 |