From caa24baac7c613c5b22d99ba5fca6cf9a311b1a3 Mon Sep 17 00:00:00 2001 From: beatles Date: Fri, 22 Feb 2008 15:37:41 +0000 Subject: [PATCH] Comments are converted to EUC-JP and then written in a log. --- changelog | 8 ++++++++ shogi-server | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/changelog b/changelog index aa639e6..c4a9c9c 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,11 @@ +2008-02-23 Daigo Moriwaki + + * [shogi-server] + - A comment is converted to EUC-JP and then written in a log. + Note that this convertion guesses the input encoding. Clients + are recommended to send EUC-JP compatible strings to the + server. + 2008-02-21 Daigo Moriwaki * [util/players-graph.rb] diff --git a/shogi-server b/shogi-server index 597f675..92c9c45 100755 --- a/shogi-server +++ b/shogi-server @@ -18,6 +18,7 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +require 'kconv' require 'getoptlong' require 'thread' require 'timeout' @@ -589,7 +590,7 @@ class Player < BasicPlayer move = array_str.shift additional = array_str.shift if /^'(.*)/ =~ additional - comment = array_str.unshift("'*#{$1}") + comment = array_str.unshift("'*#{$1.toeuc}") end s = @game.handle_one_move(move, self) @game.fh.print("#{comment}\n") if (comment && !s) -- 2.11.0