diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-26 07:52:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-26 07:52:47 +0000 |
commit | dea2732b94fda80c33db77ed827df1aca348778d (patch) | |
tree | 1c6ed3af93a7164b6ca8144f9d35a3153f6574a4 /lib/Locale/Po4a/Xml.pm | |
parent | Releasing progress-linux version 0.72-1~progress7.99u1. (diff) | |
download | po4a-dea2732b94fda80c33db77ed827df1aca348778d.tar.xz po4a-dea2732b94fda80c33db77ed827df1aca348778d.zip |
Merging upstream version 0.73.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/Locale/Po4a/Xml.pm')
-rw-r--r-- | lib/Locale/Po4a/Xml.pm | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/lib/Locale/Po4a/Xml.pm b/lib/Locale/Po4a/Xml.pm index 3666ac7..1c67bc7 100644 --- a/lib/Locale/Po4a/Xml.pm +++ b/lib/Locale/Po4a/Xml.pm @@ -899,16 +899,33 @@ sub tag_trans_xmlhead { my $out_charset = $self->get_out_charset; if ( defined $in_charset ) { - croak wrap_mod( - "po4a::xml", - dgettext( - "po4a", - "The file %s declares %s as encoding, but you provided %s as master charset. Please change either setting." - ), - $self->{'current_file'}, - $in_charset, - $input_charset - ) if ( length( $input_charset // '' ) > 0 && uc($input_charset) ne uc($in_charset) ); + if ( length( $input_charset // '' ) > 0 && uc($in_charset) ne uc($input_charset) ) { + if ( ( $in_charset eq 'UTF-8' || lc($in_charset) eq 'utf8' ) + && ( $input_charset eq 'UTF-8' || lc($input_charset) eq 'utf8' ) ) + { + croak wrap_mod( + "po4a::pod", + dgettext( + "po4a", + "The file %s declares %s as encoding, but you provided %s as master charset. Please change either setting because they really are different encoding in Perl. See https://perldoc.perl.org/Encode#UTF-8-vs.-utf8-vs.-UTF8" + ), + $self->{DOCPOD}{refname}, + $in_charset, + $input_charset, + ); + } else { + croak wrap_mod( + "po4a::pod", + dgettext( + "po4a", + "The file %s declares %s as encoding, but you provided %s as master charset. Please change either setting." + ), + $self->{DOCPOD}{refname}, + $in_charset, + $input_charset, + ); + } + } $tag =~ s/$in_charset/$out_charset/; } else { |