mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-28 07:58:08 +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
|
#!/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
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -26,6 +27,8 @@ package xloc;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
# force output in utf8
|
||||||
|
use open qw/:std :utf8/;
|
||||||
|
|
||||||
BEGIN {
|
BEGIN {
|
||||||
use Exporter ();
|
use Exporter ();
|
||||||
|
@ -160,18 +163,20 @@ sub GetNthTile($$) {
|
||||||
|
|
||||||
sub TileFace($) {
|
sub TileFace($) {
|
||||||
my ( $tileR ) = @_;
|
my ( $tileR ) = @_;
|
||||||
|
my $result;
|
||||||
|
|
||||||
my $str = ${$tileR}[2];
|
my $str = ${$tileR}[2];
|
||||||
|
|
||||||
if ( $str =~ /\'(.(\|.)*)\'/ ) {
|
if ( $str =~ /\'(.(\|.)*)\'/ ) {
|
||||||
return $1;
|
$result = $1;
|
||||||
} elsif ( $str =~ /\"(.+)\"/ ) {
|
} elsif ( $str =~ /\"(.+)\"/ ) {
|
||||||
return $1;
|
$result = $1;
|
||||||
} elsif ( $str =~ /(\d+)/ ) {
|
} elsif ( $str =~ /(\d+)/ ) {
|
||||||
return chr($1);
|
$result = chr($1);
|
||||||
} else {
|
} else {
|
||||||
die "TileFace: unrecognized face format: $str";
|
die "TileFace: unrecognized face format: $str";
|
||||||
}
|
}
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub TileValue($) {
|
sub TileValue($) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue