intfiction.org

The Interactive Fiction Community Forum
It is currently Sat Oct 20, 2018 5:37 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: unicode problem
PostPosted: Mon Jun 25, 2018 8:19 am 
Offline

Joined: Mon Apr 02, 2018 3:05 pm
Posts: 15
zarf wrote:
You can transcode I7 to I6. That's what the ni compiler does. That's the piece we're missing. :/

Other formats, no.

Thanks, it was helpful! I found auto.inf in the Build folder.


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: unicode problem
PostPosted: Mon Jun 25, 2018 8:45 am 
Offline

Joined: Mon Apr 02, 2018 3:05 pm
Posts: 15
zarf wrote:
Quote:
I downloaded an I6 source, wrote some special characters in it, and tried to compile it with the inform compiler, with -v8 flag


You need to use the -G flag (for Glulx), and -Cu (to indicate that the I6 source code is in UTF-8).

Then you need additional settings to get the I6 dictionary to be Unicode-compatible. I don't have a complete example on hand, unfortunately.

It is very adventurous :) :( It turned out that my inform compiler doesn't support unicode, because on Linux, the version is 6.31. I downloaded the inform 6.33 Windows executable, and I use it with wine.
So, I make the english-hungarian translation in gnome-inform7. Save, then quit. Recode őűŐŰ in story.ni to their ugly iso8859-1 version. Then I reopen the project in gnome-inform7, compile it, and quit again. I recode auto.inf. It wasn't straightforward, because the auto.inf wasn't utf8... I got an error. It recommended using DICT_CHAR_SIZE=4, so I appended
Code:
!% $DICT_CHAR_SIZE=4

to the first line of the auto.inf.
Ok, now it compiles, but when I play, I get errors for every command, even for quit...
Any idea, where I can find additional help, how to solve that?


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: unicode problem
PostPosted: Mon Jun 25, 2018 9:13 am 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5770
DICT_CHAR_SIZE=4 is the correct flag, but as soon as you use it, you have to replace the I6 parser code. The existing parser assumes that the dictionary and all player input is stored in bytes. You have to replace that with code which uses (32-bit) words.

My extension https://github.com/erkyrath/i7-exts/blo ... Parser.i7x contains this code. But I haven't tried to use it the way you're trying, so it will require some experimentation to get all the pieces in the right place.

I apologize for not having more explicit instructions.


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: unicode problem
PostPosted: Mon Jun 25, 2018 10:49 am 
Offline

Joined: Fri Oct 18, 2013 10:13 am
Posts: 2660
Location: The Midwest
In theory you can just include that extension into the Inform 7 project. Then write your game using replacements for all the characters ZSCII doesn't have: for instance, Hungarian doesn't use ô or û, so you could write ô û anywhere you need ő ű. Then finally, use sed to replace all ô with ő and û with ű in auto.inf before passing it to the Inform 6 compiler.

In practice I've never done this so things might break. But it seems promising! Especially for a language like Hungarian which doesn't need very many "exotic" characters. I think ő and ű are the only ones not in the original character set.

If you want to be really fancy, and make it easy to type your source on a Hungarian keyboard, you could sed ő ű into ô û before invoking ni, then sed them back afterward to pass to the Inform 6 compiler. Depends how much you want to fiddle with the build process.

_________________
Daniel Stelzer


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: unicode problem
PostPosted: Wed Jun 27, 2018 4:29 am 
Offline

Joined: Mon Apr 02, 2018 3:05 pm
Posts: 15
I tried out the recommended extension, but as soon as I included it into the I7 source, the game didn't accept any command (with simple ascii chars).


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: unicode problem
PostPosted: Wed Jun 27, 2018 10:59 am 
Offline

Joined: Mon Apr 02, 2018 3:05 pm
Posts: 15
pischta wrote:
I tried out the recommended extension, but as soon as I included it into the I7 source, the game didn't accept any command (with simple ascii chars).

I had to work on my source code conversion, then finally it worked. I didn't tested it thoroughly, but it seems it is ok now with the extension.
Thanks for the help for everyone.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group