Is there a way to make MUSHclient display everything it receives from the MUSH using EUC_JP (Japanese) encoding? And what about Japanese input?
Japanese encoding?
Posted by Philip Mak on Sat 18 Oct 2003 01:25 AM — 6 posts, 24,874 views.
Umm..
Japanese letters - No, that requires Unicode, which the output window doesn't currently support. This may become available in future versions.
Japanese input - Same issue, 'maybe'. The input box used may be a normal windows control and thus automatically support Unicode, but I am not sure.
The biggest issue in both cases is if the mud supports it. Often data sent to a mud is treated as one of two things, a) valid characters and b) control characters. Technically Unicode has no 'control' characters, so something like &h03&h41 is a single character. The mud however would see the first part of that as an invalid character and dump it, then pass a normal character &h41 'A' through instead. I expect that unicode has to be somehow 'tagged' to get through intact, even on muds that allow it, but I have no idea how it works.
Japanese letters - No, that requires Unicode, which the output window doesn't currently support. This may become available in future versions.
Japanese input - Same issue, 'maybe'. The input box used may be a normal windows control and thus automatically support Unicode, but I am not sure.
The biggest issue in both cases is if the mud supports it. Often data sent to a mud is treated as one of two things, a) valid characters and b) control characters. Technically Unicode has no 'control' characters, so something like &h03&h41 is a single character. The mud however would see the first part of that as an invalid character and dump it, then pass a normal character &h41 'A' through instead. I expect that unicode has to be somehow 'tagged' to get through intact, even on muds that allow it, but I have no idea how it works.
Well, on the server side, here is a proof-of-concept that Japanese characters work on PennMUSH:
http://lina.aaanime.net/~pmak/jap_mush.png
(look at the Japanese characters on the bottom)
This is with no special configuration on the PennMUSH; it just passes the characters through without understanding them. The characters are in EUC_JP encoding (which does not use the high-bit which can get mangled, I believe), and the client terminal is set to display using EUC_JP encoding.
http://lina.aaanime.net/~pmak/jap_mush.png
(look at the Japanese characters on the bottom)
This is with no special configuration on the PennMUSH; it just passes the characters through without understanding them. The characters are in EUC_JP encoding (which does not use the high-bit which can get mangled, I believe), and the client terminal is set to display using EUC_JP encoding.
Well. The answer would still be no. The current output window is a fast custom designed window and currently only supports a single font at one time. To support EUC_JP, you need at the absolute least to have a way to recognize the encoding and convert it to the proper characters in a font that supports Kana and/or Hiragana. Most fonts lack either and the ones that do store them in the unicode ranges, so you still need a way to put unicode characters into the window. Other clients may get by with this because they use the RichText control for display, but at the penalty of a much slower output, since the RichText control is notorious for being slow.
See this posting where I discuss at some length the problems with Unicode in MUSHclient:
http://www.gammon.com.au/forum/?bbsubject_id=2681
http://www.gammon.com.au/forum/?bbsubject_id=2681
So, I guess it's not as simple as calling a function that tells the system "interpret any text in this widget using EUC_JP encoding"?
I wrote a Japanese application using the Qt toolkit once. I had something like this:
text = 'ÆÉ¤ß:'
QLabel.new(text)
Upon running the application, the label displayed as gibberish. But then I just added these two lines to the application:
QApplication::setFont(QFont.new('MS Mincho', 12))
QApplication::setDefaultCodec(QEucJpCodec.new)
and then the Japanese text displayed properly, once the application knew (1) to use "MS Mincho" font, and (2) to interpret characters as EUC_JP encoding. I was hoping it would be this simple for MUSHclient too.
I wrote a Japanese application using the Qt toolkit once. I had something like this:
text = 'ÆÉ¤ß:'
QLabel.new(text)
Upon running the application, the label displayed as gibberish. But then I just added these two lines to the application:
QApplication::setFont(QFont.new('MS Mincho', 12))
QApplication::setDefaultCodec(QEucJpCodec.new)
and then the Japanese text displayed properly, once the application knew (1) to use "MS Mincho" font, and (2) to interpret characters as EUC_JP encoding. I was hoping it would be this simple for MUSHclient too.