I have succeeded in duplicating bug W343-3 on an American version of Windows
XP.
This bug, as reported by Mariusz Wojsyk on 16 December 2003, really consists
of two separate and unrelated bugs. The first is an issue in NT-based
versions of Windows, and not strictly speaking a NetHack bug. This bug
requires four conditions to occur:
* an NT-based version of Windows;
* the console box set to windowed mode, as opposed to full screen;
* a bitmap font selected, as opposed to Lucida Console;
* the default language for non-Unicode programs set to any that does
_not_ use code page 437 or 850. Less precisely, but perhaps more
understandably, any East European language ought to do the trick.
To set the language for non-Unicode programs, go to Control Panel and
select Regional and Language Settings. Click the third tab, Advanced. In
the box at the top, select "Polish" or some other language. Answer any
prompts for disks or to skip copying files.
This setting does not change the language of the Windows UI.
Windows will then need to reboot.
When the reboot is complete, start a command shell and play the text version
of NetHack. You will see the screen displayed incorrectly. Depending on
the font size, the incorrect glyph may be the inverted triangles that
Mariusz Wojsyk reported, or the blank tiles that Erik Piper reported on 18
May 2004, or possibly a single quote mark.
The bug is a problem in the API WriteConsoleOutputCharacterA. It does not
seem to occur in any other Windows API -- not WriteConsole, not
WriteConsoleOutput, not even WriteConsoleOutputCharacterW.
On to the second bug. This is simply a character set issue. Refer to
Mariusz's screen shot at http://republika.pl/amiro/nethack/screen1.png .
The hero's position is in the room at the right. Look at the small red
glyph to his northeast. It's '¸', or U+00B8 CEDILLA. Polish uses code
page 852, which has this character at position 0xF7. But NetHack
IBMgraphics expects code page 437, which has U+2248 ALMOST EQUAL TO at this
position. Mariusz was playing in wizard mode and had created a pool of
lava at that spot.
In all, seven characters in code page 437 used by IBMgraphics are not
present in some other code pages:
CP437 Unicode
0xAD U+00A1 '¡' Rogue level potion
0xE7 U+03C4 Rogue level wand
0xF0 U+2261 Iron bars and Rogue level stairs
0xF1 U+00B1 '±' Tree
0xF4 U+2320 Fountain
0xF7 U+2248 Water and lava
0xFA U+00B7 '·' Floor of a room
Spanish NetHack already has both bugs fixed -- the first rather by accident
(it uses WriteConsoleOutputCharacterW if it can, to support both ISO 8859-1
and full IBMgraphics when possible) and the second by explicit intention.
I am testing a patch based on these modifications and will be back shortly
to post it along with an explanation.
Meanwhile, I note that a number of RGRN regulars ought to be seeing this
second bug, because they're in countries where a code page other than 437
is the default. In particular, code page 850 is the default for most of
Western Europe, and it has the following characters in the positions named
below:
CP850 Unicode
0xE7 U+00FE 'þ'
0xF0 U+00AD '-' (soft hyphen)
0xF4 U+00B6 '¶'
0xF7 U+00B8 '¸'
It seems to me that fountains showing up as '¶' ought to be rather quickly
obvious. Does anyone see this? Or have you set the language for non-
Unicode programs to US English?
--
--------------===============<[ Ray Chason ]>===============--------------
The War on Terra is not meant to be won.
Delendae sunt RIAA, MPAA et Windoze
[snip tireless bug hunting]
Good work!
> Delendae sunt RIAA, MPAA et Windoze
I hadn't realized that Windoze was a feminine noun. <Rumage rusty
memory banks> Fenestra? I guess so.
Yes - I always see fountains as ¶. Isn't that what they're meant to
look like?
Darth.
I'm using Windows XP (Pro SP2 etc). Like many people in Sweden I use the
English-language edition of Windows. Regional settings are for Sweden
though, set when originally installed. I checked the 'non-Unicode
programs' setting you pointed out and it was set to US English. I don't
think that I have ever changed this setting.
(off-topic?)
I have noticed strange display corruption on the Rogue level though,
with NetHack*W*. Have not cared enough about it to remember any details
except that it was not a simple character-replacement, rather parts of
the map being displayed shifted one position, very confusing to
maneuvre, but I don't spend much time on the Rogue level.
/Kristoffer
--
This cookie has a scrap of paper inside. It reads:
Gurl fnl gung lbh fubhyq cenl sbe qvivar vafcvengvba.
> It seems to me that fountains showing up as '¶' ought to be rather quickly
> obvious. Does anyone see this? Or have you set the language for non-
> Unicode programs to US English?
I also see fountains as the funny backwards P character. I seem to
remember that switching between full screen and window mode would switch
between the two fountain characters, but apparently not on the computer
I'm using right now. I'm running Windows 98 using code page 850, and
fountains look like the backwards P in both modes.
> To set the language for non-Unicode programs, go to Control Panel and
> select Regional and Language Settings. Click the third tab, Advanced.
> In the box at the top, select "Polish" or some other language. Answer
> any prompts for disks or to skip copying files.
Or if one just wants to see the different letters, go to fullscreen mode
and type "mode con cp select=437" (or 850, 869 etc.)
> Meanwhile, I note that a number of RGRN regulars ought to be seeing this
> second bug, because they're in countries where a code page other than 437
> is the default. In particular, code page 850 is the default for most of
> Western Europe,
> Does anyone see this? Or have you set the language for non-
> Unicode programs to US English?
Yes, with codepage 850 I see strange letters. I never noticed because I
did not have IBMgraphics set to true.
--
Philipp Lucas
phl...@online-club.de
> Meanwhile, I note that a number of RGRN regulars ought to be seeing this
> second bug, because they're in countries where a code page other than 437
> is the default. In particular, code page 850 is the default for most of
> Western Europe, and it has the following characters in the positions named
> below:
>
> CP850 Unicode
> 0xE7 U+00FE 'þ'
> 0xF0 U+00AD '-' (soft hyphen)
> 0xF4 U+00B6 '¶'
> 0xF7 U+00B8 '¸'
>
> It seems to me that fountains showing up as '¶' ought to be rather quickly
> obvious. Does anyone see this?
Yes. But it's been that way ever since I started using Windows for
NetHack, and on that computer I could not set the code page for work-
related reasons, so I got used to it.
> Or have you set the language for non-Unicode programs to US English?
No. Then again, on this computer the only non-Unicode DOS program I use
with any frequency is NH, so I might as well. OTGH, the only character
for which it would make a useful difference is the water/lava one.
Richard
>
> Ray Chason wrote:
>> <snip>
<further snip>
>> CP850 Unicode
>> 0xE7 U+00FE 'ţ'
>> 0xF0 U+00AD '-' (soft hyphen)
>> 0xF4 U+00B6 'ś'
>> 0xF7 U+00B8 '¸'
>>
>> It seems to me that fountains showing up as 'ś' ought to be rather
>> quickly
>> obvious. Does anyone see this? Or have you set the language for non-
>> Unicode programs to US English?
>
> Yes - I always see fountains as ś. Isn't that what they're meant to
> look like?
What code page 437 has in this position is U+2320 TOP HALF INTEGRAL. It
looks rather like a straight vertical line with a curving hook at the top.
It's not hard to imagine a fountain from this, especially if it's printed
in blue.
> (off-topic?)
> I have noticed strange display corruption on the Rogue level though,
> with NetHack*W*. Have not cared enough about it to remember any details
> except that it was not a simple character-replacement, rather parts of
> the map being displayed shifted one position, very confusing to
> maneuvre, but I don't spend much time on the Rogue level.
That's probably because some of the symbols used on that level are below
ASCII 0x20 (e.g. it tries to use the cp437 "smiley" face char for your
character symbol), and your terminal refuses to display these characters.
I toggle IBMGraphics when I get to this level, for this reason.
Any recent xterm in combination with IBMGraphics experiences this problem
as well, and most other unix terms that I've tried.
--
Benjamin Lewis
Now is the time for all good men to come to.
-- Walt Kelly
YAHI: Replace the player '@' symbol with a smiley face, that gets less
and less smiley as you lose HP/ get sick/ ill.
...and becomes a skull when you're dead.
Janis
> Benjamin Lewis <bcl...@alumni.sfu.ca> writes:
>> Kristoffer Björkman wrote:
>
>>> I have noticed strange display corruption on the Rogue level though,
>>> with NetHack*W*. Have not cared enough about it to remember any details
>>> except that it was not a simple character-replacement, rather parts of
>>> the map being displayed shifted one position, very confusing to
>
>> That's probably because some of the symbols used on that level are below
>> ASCII 0x20 (e.g. it tries to use the cp437 "smiley" face char for your
>> character symbol), and your terminal refuses to display these
>> characters.
>
> Yes, I experenced the same problem with the Linux console with the
> Nethack version that was current when I first installed Linux. I changed
> the offending characters to more reasonable ones in the source and
> reported to the devteam. And IIRC, it got fixed in the next version. Do
> you (Kristoffer and Benjamin) use some old version of the game?
Not unless there's a new version I don't know about; I'm using 3.4.3. The
offending code is in the assign_rogue_graphics function in drawing.c:
-----
void
assign_rogue_graphics(is_rlevel)
boolean is_rlevel;
{
/* Adjust graphics display characters on Rogue levels */
if (is_rlevel) {
register int i;
(void) memcpy((genericptr_t)save_showsyms,
(genericptr_t)showsyms, sizeof showsyms);
(void) memcpy((genericptr_t)save_oc_syms,
(genericptr_t)oc_syms, sizeof oc_syms);
(void) memcpy((genericptr_t)save_monsyms,
(genericptr_t)monsyms, sizeof monsyms);
/* Use a loop: char != uchar on some machines. */
for (i = 0; i < MAXMCLASSES; i++)
monsyms[i] = def_monsyms[i];
# if defined(ASCIIGRAPH) && !defined(MSWIN_GRAPHICS)
if (iflags.IBMgraphics
# if defined(USE_TILES) && defined(MSDOS)
&& !iflags.grmode
# endif
)
monsyms[S_HUMAN] = 0x01; /* smiley face */
# endif
for (i = 0; i < MAXPCHARS; i++)
showsyms[i] = defsyms[i].sym;
-----
Note in particular the line
monsyms[S_HUMAN] = 0x01; /* smiley face */