Community
    • Login

    ASCII Hex of Current Character

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 2.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • iamtestplayI
      iamtestplay
      last edited by

      Hi, Is there a setting in notepad++ that displays the ASCII hex of the current character under the cursor? Edit plus has this feature that displays it beside the line number and column number. If so, how can I activate it in Notepad++?

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Scott SumnerS
        Scott Sumner @iamtestplay
        last edited by

        @iamtestplay

        I don’t believe this is possible…without scripting. With scripting (e.g. Pythonscript plugin), however, it is fairly straightforward–for the simplistic case of ASCII and not Unicode–if you don’t mind part of the statusbar being utilized for the display:

        Imgur

        Script:

        def callback_sci_UPDATEUI(args):
            c = editor.getCharAt(editor.getCurrentPos())
            try:
                info = "HEX:{0:02X} DEC:{0} '{1}'".format(c, chr(c) if c not in [13, 10, 0] else 'LINE-ENDING' if c != 0 else 'END-OF-FILE')
            except ValueError:
                info = "HEX:?? DEC:?"
            notepad.setStatusBar(STATUSBARSECTION.DOCTYPE, info)
        editor.callback(callback_sci_UPDATEUI, [SCINTILLANOTIFICATION.UPDATEUI])
        
        1 Reply Last reply Reply Quote 1
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors