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 |
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 | 1 | FF11 |
2nd column | 2 | FF12 |
3rd column | 3 | FF13 |
4th column | 4 | FF14 |
5th column | 5 | FF15 |
6th column | 6 | FF16 |
7th column | 7 | FF17 |
8th column | 8 | FF18 |
9th column | 9 | 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.
674f not 6740 for +L
ReplyDeleteThank you for spotting this. I've fixed the post.
DeleteDo 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?
DeleteI am not sure that I get your question right, but after re-reading I get the point.
DeleteHere 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.