Handling of non-english characters

Hi all,
I am desperately trying to write an Inform 6 application in Greek.
Before dealing with serious grammar/vocabulary issues, I am trying to sort out character set reading and printing.
Based on the very detailed instructions by Roger Firth (http://www.firthworks.com/roger/informfaq/aa20.html) I am using the -C7 compiler switch inside my source file (!% -C7).
The interpreter I am using is Windows Frotz 1.15
As far as printing Greek characters is concerned I get the desired result since my messages and strings in Greek are printed successfully in the game screen. Also when I type in Greek in the game screen the characters also appear correctly. Both of the previous where not happening before I added the C7 switch. So that’s good.
The problem is with the input. I have not succeeded in the program reading correctly the input. Whenever I write a command in the game screen in Greek the program fails to understand it (even the most basic ones like directions), even though I have made the necessary changes in the Grammar and English files.
The problem has not anything to do with understanding the command but, instead, with correctly interpreting the characters.
I tried the program “Unicode.inf” (attached) which comes together with Windows Frotz 1.15 after adding the -C7 switch. Still when I am typing a Greek character, I get back a question mark which means that the program does not understand my character…
Please let me know if anyone has any ideas on what I’m doing wrong…
Thanks,
Babis

At a guess, I’d suspect there is a mismatch between the character encoding you’re using for the game’s source file, and between what Inform is expecting. With ‘-C7’ it expects ISO 8859-7, but I suspect what you’re using is Windows CP1253, which I don’t think is the same.

On the other hand, I would expect this to also mess up output strings, so possibly it isn’t that. It may also be due to issues with the Zcharacter table (see the section “String packing” on Roger’s page that you linked to). This sort of thing has been made to work, as someone did a Russian translation of Andrew Plotkin’s Spider and Web.

Would you be prepared to put the source files somewhere I could have a look at it?

Hi David,
Thank you very much for your answer. With -C7 indeed Inform is expecting ISO 8859-7. You’re saying that you suspect I’m using CP1253. What do you mean exactly? How can I look into that? I’m just running the game, switch the keyboard to Greek and hit the keys for the Greek Letters. I see the letters appearing correctly on my screen but then the program does not understand anything.

I’m afraid I did go through the string packing section but didn’t get much out of it. It’s too subtle for me…

Of course, I have the source files attached in this post but do not expect much, since I am not yet in a posision to proceed with any serious development. The zip file I have attached contains the following:

  • GreekGame.inf: Nothing more than the sample game that I got with the directory structure from Roger’s site, with the -C7 switch added and a string written in Greek (the description of the initial room)
  • Greek.h, GrammarGr.h: copies of the english files. The only change is on Greek.h, the four basic compass objects (n, s, e, w) where the names have been switched to greek. Still when giving the greek names during gameplay it just doesn’t work (“That’s not a verb I recognize”).
  • GreekGame.bat: The string to compile the game (I know that the -C7 switch here is obviously reduntant)
  • Unicode.inf: This is also one of the example games i got with the directory structure. In this program, when I add the -C7 switch and still when during runtime I am hitting Greek characters I get question marks…
  • I have also included a screenshot of the GreekGame during gameplay where you can see that Greek characters are typed and presented correctly but when I give the east direction in Greek the program does not understand it…
    GreekGame_ScreenShot.JPG
    post.zip (14.9 KB)

Problem solved. I did not know that the parser turns everything to lower case. I had written names in grammar library in uppercase greek.
Sorry for the confusion, case closed.

Glad to hear you figured it out :slight_smile: