Created
August 25, 2009 10:01
-
-
Save poppen/174611 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/lib/MENTA.pm b/lib/MENTA.pm | |
| index a68fa7a..9fc6d1e 100644 | |
| --- a/lib/MENTA.pm | |
| +++ b/lib/MENTA.pm | |
| @@ -272,13 +272,32 @@ sub static_file_path { | |
| # HTTP の入り口んとこで decode させる用 | |
| sub decode_input { | |
| - my ($txt, $fb) = @_; | |
| - if (MENTA->context->config->{menta}->{support_mobile}) { | |
| - require_once('Encode.pm'); | |
| - Encode::decode(_mobile_encoding(), $txt, $fb); | |
| - } else { | |
| - utf8::decode($txt); | |
| - $txt; | |
| + if (wantarray) { | |
| + my (@txts, $fb) = @_; | |
| + my @result = (); | |
| + | |
| + if (MENTA->context->config->{menta}->{support_mobile}) { | |
| + require_once('Encode.pm'); | |
| + foreach my $txt (@txts) { | |
| + push( @result, Encode::decode(_mobile_encoding(), $txt, $fb) ); | |
| + } | |
| + @result; | |
| + } else { | |
| + foreach my $txt (@txts) { | |
| + push( @result, utf8::decode($txt) ); | |
| + } | |
| + @result; | |
| + } | |
| + } | |
| + else { | |
| + my ($txt, $fb) = @_; | |
| + if (MENTA->context->config->{menta}->{support_mobile}) { | |
| + require_once('Encode.pm'); | |
| + Encode::decode(_mobile_encoding(), $txt, $fb); | |
| + } else { | |
| + utf8::decode($txt); | |
| + $txt; | |
| + } | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment