Skip to content
Snippets Groups Projects

DDMsgReader: Added "indexed" reader mode and made a fix to print utf-8 characters properly on non utf-8 terminals. Fixes issue #354 and issue #541

Closed Eric Oulashin requested to merge dd_msg_reader_indexed_mode_and_utf8_fix into master
1 unresolved thread

DDMsgReader: Added "indexed" reader mode and made a fix to print utf-8 characters properly on non utf-8 terminals. Fixes issue #354 (closed) and issue #541 (closed)

Note that this includes an updated dd_lightbar_menu.js (for sbbs/exec/load). The most significant update in dd_lightbar_menu is that a DDLightbarMenu can now include non-selectable items. Such items will be skipped when scrolling through the menu.

Edited by Eric Oulashin

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Eric Oulashin changed the description

    changed the description

  • merged

  • Rob Swindell mentioned in commit 76b20f2d

    mentioned in commit 76b20f2d

    • Where's the actual UTF-8 bug fix in this commit?

    • Author Developer

      I saw that msglist.js had the msg_pmode() function, so I copied that to DDMsgReader.js:

      function msg_pmode(pMsgbase, pMsgHdr)
      {
      	var pmode = pMsgHdr.hasOwnProperty("is_utf8") && pMsgHdr.is_utf8 ? P_UTF8 : P_NONE;
      	if (pMsgHdr.from_ext !== "1")
      		pmode |= P_NOATCODES;
      	if (pMsgbase.cfg)
      	{
      		pmode |= pMsgbase.cfg.print_mode;
      		pmode &= ~pMsgbase.cfg.print_mode_neg;
      	}
      	return pmode;
      }

      That's called on line 15672: retObj.pmode = msg_pmode(msgbase, pMsgHdr);

      For the scrollable interface (for ANSI), that value ends up getting passed to the scrollTextLines() function, as an optional parameter. And then the pmode value is passed to console.print(), as on line 16923:

      console.print(pTxtAttrib + pTxtLines[lineIdx], typeof(pmode) === "number" ? pmode|P_NOATCODES : P_NOATCODES);

      Edited by Eric Oulashin
    • Please register or sign in to reply
Please register or sign in to reply
Loading