Jump to content
  • Advertisement
Sign in to follow this  
benryves

DOS extended ASCII characters to RTF (also: MS Word's space issue)

This topic is 4906 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm writing a DOOM WAD viewer (Visual Basic .NET). One resource it can view and extract are the DOS exit screens, which are 4000 bytes (80x25 res, 2000 pairs of colour info then character ASCII code). The format that it exports to (and internally converts to to display) is RTF. However, there are certain characters in the DOS extended ASCII that do not match up with those in Windows, which I currently escape with \u#?, getting the Unicode character code from a lookup (not good). Is there is a way that you can convert a DOS ascii code number to a Unicode code number, through a function? (Or do I stick with that unsightly LUT?) The other issue is that MS Word seems to have problems with the RTF files I export. write.exe and the VB.NET RichTextBox control have not got this issue - that if the end of a line is padded with spaces (with the row highlighted in a colour) then Word ignores it and leaves the end of the row blank (white), which looks silly. Is there a way around this, or do I just accept that Word is weird? (I'm highlighting lines with \highlight#).

Share this post


Link to post
Share on other sites
Advertisement
If you don't mind a bit of P/Invoke, then you can use the MultiByteToWideChar function, passing the MB_USEGLYPHCHARS flag will convert those extra characters to their Unicode equivalents.

Unfortunately, that flag is a bit useless, since it only converts those extended characters (!) I think your current mapping table is probably just as good (and I don't think a P/Invoke would make it much faster).

For your other problem, I don't know :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!