diff options
Diffstat (limited to 'tools/credits.pl')
-rwxr-xr-x | tools/credits.pl | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/tools/credits.pl b/tools/credits.pl index 45c66abed6..c1a5fd47b9 100755 --- a/tools/credits.pl +++ b/tools/credits.pl @@ -85,6 +85,25 @@ sub html_entities_to_ascii { return $text; } +# Convert HTML entities to C++ characters +sub html_entities_to_cpp { + my $text = shift; + + $text =~ s/á/\\341/g; + $text =~ s/é/\\351/g; + $text =~ s/ó/\\363/g; + $text =~ s/ø/\\370/g; + $text =~ s/ł/l/g; + + $text =~ s/ä/\\344/g; + $text =~ s/ö/\\366/g; + $text =~ s/ü/\\374/g; + + $text =~ s/&/&/g; + + return $text; +} + # Convert HTML entities to RTF codes sub html_entities_to_rtf { my $text = shift; @@ -240,11 +259,11 @@ sub begin_section { if ($section_level eq 0) { # TODO: Would be nice to have a 'fat' or 'large' mode for # headlines... - $title = html_entities_to_ascii($title); + $title = html_entities_to_cpp($title); print '"\\\\C\\\\c1""'.$title.'",' . "\n"; print '"\\\\C\\\\c0""",' . "\n"; } else { - $title = html_entities_to_ascii($title); + $title = html_entities_to_cpp($title); print '"\\\\C\\\\c1""'.$title.'",' . "\n"; } } elsif ($mode eq "XML") { @@ -364,13 +383,13 @@ sub add_person { } } elsif ($mode eq "CPP") { $name = $nick if $name eq ""; - $name = html_entities_to_ascii($name); + $name = html_entities_to_cpp($name); print '"\\\\C\\\\c0""'.$name.'",' . "\n"; # Print desc wrapped if (length $desc > 0) { - $desc = html_entities_to_ascii($desc); + $desc = html_entities_to_cpp($desc); print '"\\\\C\\\\c2""'.$desc.'",' . "\n"; } } elsif ($mode eq "XML") { |