OSDN Git Service

Comments are converted to EUC-JP and then written in a log.
authorbeatles <beatles@b8c68f68-1e22-0410-b08e-880e1f8202b4>
Fri, 22 Feb 2008 15:37:41 +0000 (15:37 +0000)
committerbeatles <beatles@b8c68f68-1e22-0410-b08e-880e1f8202b4>
Fri, 22 Feb 2008 15:37:41 +0000 (15:37 +0000)
changelog
shogi-server

index aa639e6..c4a9c9c 100644 (file)
--- a/changelog
+++ b/changelog
@@ -1,3 +1,11 @@
+2008-02-23 Daigo Moriwaki <daigo at debian dot org>
+
+       * [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 <daigo at debian dot org>
 
        * [util/players-graph.rb]
index 597f675..92c9c45 100755 (executable)
@@ -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)