http://bugs.winehq.org/show_bug.cgi?id=15314
--- Comment #4 from Jörg Höhle hoehle@users.sourceforge.net 2008-10-14 04:26:55 --- Eric, Thank you for the patch, it worked with the .hlp file.
make it pass the discriminatory gates of wine-patches
Did you mean that your fix was rejected for unknown reasons?
I believe a fix in this area is necessary, to escape the garbage-in -> garbage-out cycle: the RTF generated by Wine must be correct, even when the .hlp may be partly broken, like you say. So a fix is needed, no debate.
However, I wonder whether your check if (!ch || !isalpha(ch)) break; is a good one.
1. '-', ' ' etc. may be found in font names. isprint() maybe adequate instead.
2. AFAIK, LogFont.lfFaceName is subject to some encoding (which one is used?), so I don't know whether the UNIX locale used by isalpha()/isprint() is appropriate. BTW, I read in WineLoc that MS produced fonts with native CJK names, obviously non-ASCII.
Is there some helper function in wine to determine whether a string is correctly encoded?
Why did you make your patch abort the loop upon encountering illegal characters, yielding a partial font name? Don't you think it would be "better" (somehow?) to just skip a fontname directive entirely when a broken name is encountered?