mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-27 07:58:49 +01:00
force output in UTF-8 -- fixes German BYOD display and still works for English
This commit is contained in:
parent
f42fbf62c4
commit
b45fcf2aa6
1 changed files with 9 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
# Copyright 2002 by Eric House (xwords@eehouse.org). All rights reserved.
|
||||
# Copyright 2002-2014 by Eric House (xwords@eehouse.org). All rights
|
||||
# reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
|
@ -26,6 +27,8 @@ package xloc;
|
|||
|
||||
use strict;
|
||||
use warnings;
|
||||
# force output in utf8
|
||||
use open qw/:std :utf8/;
|
||||
|
||||
BEGIN {
|
||||
use Exporter ();
|
||||
|
@ -160,18 +163,20 @@ sub GetNthTile($$) {
|
|||
|
||||
sub TileFace($) {
|
||||
my ( $tileR ) = @_;
|
||||
my $result;
|
||||
|
||||
my $str = ${$tileR}[2];
|
||||
|
||||
if ( $str =~ /\'(.(\|.)*)\'/ ) {
|
||||
return $1;
|
||||
$result = $1;
|
||||
} elsif ( $str =~ /\"(.+)\"/ ) {
|
||||
return $1;
|
||||
$result = $1;
|
||||
} elsif ( $str =~ /(\d+)/ ) {
|
||||
return chr($1);
|
||||
$result = chr($1);
|
||||
} else {
|
||||
die "TileFace: unrecognized face format: $str";
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub TileValue($) {
|
||||
|
|
Loading…
Add table
Reference in a new issue