From: beatles Date: Fri, 22 Feb 2008 15:37:41 +0000 (+0000) Subject: Comments are converted to EUC-JP and then written in a log. X-Git-Tag: 20170902~295 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=caa24baac7c613c5b22d99ba5fca6cf9a311b1a3;p=shogi-server%2Fshogi-server.git Comments are converted to EUC-JP and then written in a log. --- 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)