Community
    • Login

    ASCII Hex of Current Character

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 3.0k Views 2 Watching
    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 Offline
      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 Offline
        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
        • Jeff HeathJ Jeff Heath referenced this topic on

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors