/[webpac]/trunk/tests/test_charset.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/tests/test_charset.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 278 - (hide annotations)
Sun Mar 14 12:37:14 2004 UTC (16 years, 4 months ago) by dpavlin
File MIME type: text/plain
File size: 812 byte(s)
moved tests in own directory, added test to demonstrate XML::Simple feature
to remove spaces from begin and end attribute value (which is wrong for
delimiters as WebPAC uses them)

1 dpavlin 61 #!/usr/bin/perl -w
2    
3     use strict;
4     use OpenIsis;
5     use Text::Iconv;
6     use XML::Simple;
7     use Data::Dumper;
8    
9     Text::Iconv->raise_error(1); # Conversion errors raise exceptions
10    
11     #my $to = "UTF-8";
12     my $to = "ISO-8859-2";
13    
14     my $isis_codepage = Text::Iconv->new('852',$to);
15    
16     my $isis_db="/data/isis_data/small/ps/PERI/PERI";
17     my $row_id = 11;
18    
19     my $db = OpenIsis::open( $isis_db );
20    
21     my $row = OpenIsis::read( $db, $row_id );
22    
23     use isis_sf;
24    
25     print isis_sf($row,'200'),"\n";
26    
27     my $xml = '<?xml version="1.0" encoding="ISO-8859-2"?><xml>truæ</xml>';
28     #my $xml_codepage = Text::Iconv->new('ISO-8859-2','UTF-8');
29     #$xml = XMLin($xml_codepage->convert($xml));
30    
31     $xml = XMLin($xml);
32    
33     #undef $xml_codepage;
34     my $xml_codepage = Text::Iconv->new('UTF-8','iso-8859-2');
35     $xml = $xml_codepage->convert($xml),"\n";
36    
37     print Dumper($xml),"$xml\n";
38    

Properties

Name Value
cvs2svn:cvs-rev 1.1
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26