Monday, June 23, 2008

Unicode for Shogi characters


To be able to translate Shogi data between formats you have to know possible piece symbols. I collected  the information I could get (mainly from wikipedia.org) in the following table. Then I found (on http://www.rikai.com/library/kanjitables/kanji_codes.unicode.shtml) unicode values for eaech Shogi piece.
Shogi pieces



















































































































































































English name


Unicode

for abbr. Kanji


Kanji


Rōmaji


Meaning


Abbreviations


Symbol


Kanji


Rōmaji


King (reigning)


738B


王将


ōshō


royal general


K





ō


King (challenging)


7389


玉将


gyokushō


jeweled general


K





gyoku


Rook


98DB


飛車


hisha


flying chariot


R





hi


Promoted rook (Dragon)


9F8D or 7ADC


龍王


ryūō


dragon king


+R


龍 or



ryū


Bishop


89D2


角行


kakugyō


angle mover


B





kaku


Promoted bishop (Horse)


99AC


龍馬


ryūma or ryūme


dragon horse


+B





uma


Gold general (Gold)


91D1


金将


kinshō


gold general


G





kin


Silver general (Silver)


9280


銀将


ginshō


silver general


S





gin


Promoted silver


5168


成銀


narigin


promoted silver


+S








Knight


6842


桂馬


keima


horse


N





kei


Promoted knight


572D or 4ECA


成桂


narikei


promoted laurel


+N


(圭 or
今)





Lance


9999


香車


kyōsha


incense chariot


L





kyō


Promoted lance


674F or 4EDD


成香


narikyō


promoted incense


+L


(杏 or
仝)





Pawn


6B69


歩兵


fuhyō


foot soldier


p





fu


Promoted pawn (tokin)


3068 or 4E2A


と金


tokin


reaches gold


+p


と (or
个)


to


Coordinates
In KIF files the characters are Shift-JIS encoded. Characters used to describe shogi board coordinates and their unicode values are listed below.





































































































description


char


unicode


1st column





FF11


2nd column





FF12


3rd column





FF13


4th column





FF14


5th column





FF15


6th column





FF16


7th column





FF17


8th column





FF18


9th column





FF19


1st row





4E00


2nd row





4E8C


3rd row





4E09


4th row





56DB


5th row





4E94


6th row





516D


7th row





4E03


8th row





516B


9th row





4E5D




Move modificators
The symbols used in Kifu to identify the piece to move (when there is
a situation in which more then one piece of the same kind can reach
given destination):




































































symbol

unicode

meaning


76F4

move straight


5F15

pull (back)


4E0A

go forward (literally means “up”)


5BC4

go to the side


53F3

right


5dE6

left

右引





right-back

右寄





right-go to the side

右上





right up

左引





left-back

左寄





left-go to the side

左上





left up


I hope someone finds this information useful.

4 comments:

  1. Replies
    1. Thank you for spotting this. I've fixed the post.

      Delete
    2. Do you think that it would be better to encode characters that actually look like the shogi pieces? because I cannot see how you would be able to represent a board (do you invert the ideographs for the other players? how?). Aren't you of the opinion that having such characters would simplify the notation?

      Delete
    3. I am not sure that I get your question right, but after re-reading I get the point.
      Here what I had in mind was mostly Shogi notation.
      Unicode, in my opinion, are perfectly fine for this.
      They should be also quite fine for diagrams (problems). Take a look at this: http://blogimg.goo.ne.jp/user_image/76/3d/291514248529057801a373409e39756e.png

      I tend to agree, that for board visualisation purposes having pieces would be much more user friendly.

      Delete