• 0 Votes
    2 Posts
    298 Views
    Alan KilbornA

    There is a text file it looks like this Macintosh encoding
    mortification
    honey
    micropattern
    cash

    This text was copied from another text file which has normal Russian language without ¤ symbols

    I take it and replace ¤ with I Encode the text in UTF 8 and then save it in ensi, restart the text file and again the same words with the symbols ¤ and Macintosh encoding

  • can no emails formattad

    5
    1 Votes
    5 Posts
    344 Views
    guy038G

    Hello, @dj.michael-beil.-de-omt24-corp, @coises, @mkupper and All,

    Yes,… Indeed, just a typo :-((

    So, regarding my first regex search expression, the right syntax is the @mkupper’s one !

    BR

    guy038

  • 1 Votes
    4 Posts
    2k Views
    xomxX

    The new NppShell is cleverly designed to work in both the new Win11 menu and at the same time in the old classic one. Implementation details:
    https://github.com/notepad-plus-plus/nppShell/commit/8f26080a71594f4f24de43d06ee1c906a8bc0b1d

    I can use both in my Win11 after the usual installation. No need for additional Registry hacks.

  • Tabs not showing on startup

    7
    1 Votes
    7 Posts
    1k Views
    mkupperM

    I created a new issue on github as the tab bar should not have appeared like that.

  • Notepad++ 8.6 Bug???

    3
    1 Votes
    3 Posts
    582 Views
    rdipardoR

    @Dave-D said in Notepad++ 8.6 Bug???:

    19ce7d1b-907a-4e64-b7d5-f077c321c1ae-image.png

    Versions of HTML Tag before 1.2.3 have trouble detecting “point zero” (.0) release numbers like 8.6: https://community.notepad-plus-plus.org/post/76001

    You just need to upgrade the plugin. The installer at Plugins > Plugins Admin should be offering 1.4.1. After that, open the About menu and click on “Bugs” if you have more to report.

  • How do I remove lots of empty space when scrolling to end of file?

    3
    1 Votes
    3 Posts
    448 Views
    mahajuM

    Wow that was it thanks a lot
    I didn’t expect this to have such a simple solution

  • 1 Votes
    5 Posts
    945 Views
    mkupperM

    @Chris I should add that Notepad++ has a couple of command line options that may be helpful.

    -noPlugin can be used to establish a baseline of how quickly npp starts with whatever your configuration settings are but with no plugins at all.

    -loadingTime - the documentation for this is vague and I don’t know what this measures. When I tried it, I always get a popup with either Loading time : 0 seconds or Loading time : 1 seconds. Maybe with your configuration and/or 24 plugins it’s a more useful metric.

    As with all of Notepad++'s command line parameters, they are case-sensitive.

  • Re: Notepad++ v8.6 Release: 20th-Year Anniversary

    3
    9 Votes
    3 Posts
    499 Views
    Lycan ThropeL

    @Michael-Vincent ,
    And on that note, wishing all of you a Happy Thanksgiving, should you be celebrating it. :-)
    Also to Notepad++'s Anniversary and another 20 years…if @donho is up to it. :-)

  • Notepad++ 8.6 download problem

    3
    0 Votes
    3 Posts
    521 Views
    Murray Sobol 1M

    Thanks Peter, I waited 30 minutes or so and then retried the download.
    Everything works as expected.

    Thanks

  • How to convert Encode64 to pdf file using Notepad++?

    6
    0 Votes
    6 Posts
    6k Views
    PeterJonesP

    @Olivier-De-Groef ,

    The script you are replying to, from four years ago, has nothing to do with Notepad++.

    It appears it might be javascript intended to be run in the browser, but I wouldn’t run it without fully understanding the code. (I tried to base64-decode the string that the script supplied, for example, but it doesn’t end up starting with the bytes %PDF, so I am pretty sure it doesn’t decode into a PDF file like it purported to doing; as such, I really wouldn’t trust anything in that script.)

    The right answer to the 2019 question is the one Alan gave in 2019: “you don’t”.

    PDF is a binary format, not a text format, and Notepad++ is a text editor.

    => FAQ

  • Default File Types On Installation

    4
    0 Votes
    4 Posts
    2k Views
    PeterJonesP

    @John-Furby said in Default File Types On Installation:

    My question wasn’t so much, “How can I make it default?” but rather why isn’t this an installation option?

    It’s called a “design decision”. The designers of every application in existence make them. As a user, you disagree with some and agree with others. If what you like about an application’s design decisions outweigh what you don’t like, then you continue to use the product, otherwise you find something else that’s more to your taste. Since you paid nothing for this software, the only thing you need to lose is your time.

    “Why” can actually be a strange question to ask w/r/t design decisions, because sometimes it really was just a preference or even an arbitrary choice by the designer at some moment in time.
     
    But since you asked: my guess as to the “why”: the Settings > Preferences > File Association was the developer’s answer to the request to be able to easily associate file types with Notepad++. Because why stop at just .txt ? or just .txt and .xml? or txt and xml and HTML and c/c++/h and py and … And what about the people who want .txt associated with something else but .npp associated with Notepad++?

    In other words: the designer probably felt that the user interface already in the app was better suited to handle all the exceptions that people would want, rather than during the installation process ask for the 217 extensions across the ~90 languages that are known during initial installation, most of which the user wouldn’t care about (when the designer could not know which would be the important extensions to a given user; for some, TXT and XML are the important ones; for others, they never edit those, and only touch C/CPP/H; for others, some other combination – making any choice to favor one set of extensions above another would be bound to annoy a not-insignificant subset of users as much as the current situation annoys you.)

    If you want a one-stop location to change the associations, which will ask for the “major” extensions (whatever that means) plus allow you to add your own extensions, the Settings > Preferences > File Association was designed to do exactly that.

    I’m a bit surprised it is not highly requested feature.

    I’m not. (The following is my interpretation of events as I understand them.)

    For years, Windows made it easy for applications to set the default associations. And for years, new applications would hijack filetypes without permission. And even those that did play nice and ask would still mess with things in an annoying way (for example, once you associated .txt and .xml with Notepad++, it would show up as “Notepad++ Text File” for all of them, rather than keeping the individual identities of “Text Document”, “XML Document”, and the like).

    As such, MS got a lot of complaints about how annoying that system was, and how hard it was for users to change the defaults if the app didn’t play nice (or if they didn’t remember where each app buried their un-associate ability).

    So MS started giving users the “Open With” possibility, to make it easy for the user rather than the application/installer to change the default app for a filetype, and simultaneously made it harder for (non-Microsoft) applications to actually get the default-app status when they asked for it. Many users find this a win, not a loss (except that MS apps don’t follow their own guidelines of not hijacking file types).

    Most Notepad++ users only have a few filetypes, so it’s not onerous for them to change their Open With for that handful of filetypes. Especially because, for non-associated file types, **Right Click > Edit With Notepad++ ** still works to open them quickly in Notepad++.

    For those who have more filetypes which they’d like to associate, the Settings > Preferences > File Association is usually the next best action.

    If that’s not sufficient, the Online User Manual has a section on Notepad Replacement which uses a Registry hack to make it so that any time that Windows tries to run notepad.exe, it really runs notepad++.exe instead).

    And for the remaining users who have more than a handful of types, but who do not wish to go so drastic as to try to trick the OS, they generally know how to dig into the registry and change their associations more powerfully than any installer or Open With could.

    But I, like you, am just a user of Notepad++, and my opinion only matters as much as yours, not any more and not any less. You can discuss new features here in the Community Forum all you want, but it’s not the official feature request location (see our FAQ), so this discussion will not result in any official decision.

  • Save session

    2
    1 Votes
    2 Posts
    226 Views
    Alan KilbornA

    @Joe-Cool2021

    I agree. Session management functions are underdeveloped.

  • Is there a way to search for duplicate records in Notepad++?

    9
    0 Votes
    9 Posts
    191k Views
    Alan KilbornA

    @guy038 said in Is there a way to search for duplicate records in Notepad++?:

    Why do you want to mark all the duplicate lines ?

    A practical reason (not involving copy/cut/delete) for this might be so that each duplicate line can be visited and manually edited to be made unique in some way.

  • Linebreak after text with number in different lengh

    3
    1 Votes
    3 Posts
    265 Views
    AndiA

    @Coises That worked perfectly, many thx for the fast response. Have a nice day.

  • 0 Votes
    6 Posts
    1k Views
    Fuel DZNF

    @Alan-Kilborn said in PythonScript: How to interact with dialogue boxes?:

    That was my exact experience too. And even though inspect.exe shows the search result window, pywinauto still can’t find it.

    I instead opted to use this code made by someone here. With it I could create a script that suited my own uses, which I’ve now adapted it into something more general purpose below. It searches across multiple directories, reads the search results and allows you to open the files. (To anyone that uses it: make sure ‘Purge for every search’ is enabled in the search results context menu.)

    # encoding=utf-8 from ctypes.wintypes import BOOL, HWND, LPARAM import ctypes import os.path import re import time from Npp import editor from pywinauto.application import Application console.clear() console.show() console.editor.setReadOnly(False) def get_search_results(): WNDENUMPROC = ctypes.WINFUNCTYPE(BOOL, HWND,LPARAM) FindWindow = ctypes.windll.user32.FindWindowW GetWindowText = ctypes.windll.user32.GetWindowTextW GetWindowTextLength = ctypes.windll.user32.GetWindowTextLengthW EnumChildWindows = ctypes.windll.user32.EnumChildWindows GetClassName = ctypes.windll.user32.GetClassNameW curr_class = ctypes.create_unicode_buffer(256) search_results = '' def foreach_window(hwnd, lParam): global search_results length = GetWindowTextLength(hwnd) if length > 0: buff = ctypes.create_unicode_buffer(length + 1) GetWindowText(hwnd, buff, length + 1) if buff.value.startswith('Search "'): search_results = str(buff.value) return False return True EnumChildWindows(FindWindow(u'Notepad++', None), WNDENUMPROC(foreach_window), 0) def open_files(): try: file_list = re.findall(r'(C:\\.*)(?: \([0-9] hits?\))', search_results) except: console.editor.addStyledText(Cell('\nNo search results detected', [1])) count = str(len(file_list)) if count == '0': console.editor.addStyledText(Cell('\nNo files in results', [1])) return prompt = notepad.messageBox('Open all ' + count + ' files?', '', 1) if prompt == 1: for file in file_list: if os.path.isfile(file): notepad.open(file) else: console.editor.addStyledText(Cell('\nFiles/directory not found', [1])) break app.wait_cpu_usage_lower(threshold=20, timeout=600) # wait until CPU usage is lower than 20% notepad.menuCommand(MENUCOMMAND.SEARCH_FINDINFILES) app = Application().connect(path=r"C:\Program Files\Notepad++\notepad++.exe") find_in_files = app.FindInFiles directories_list = 'list of directories' pattern = r'pattern' for directory in directories_list: notepad.menuCommand(MENUCOMMAND.SEARCH_FINDINFILES) app.find_in_files.FindWhat_Edit.set_text(pattern) app.find_in_files.Directory_Edit.set_text(directory) app.find_in_files.FindAll.click() app.wait_cpu_usage_lower(threshold=20, timeout=600) get_search_results() open_files() time.sleep(0.1) # this is needed if the prompt is removed from open_files()
  • T-SQL highlighting problem: backslash is not an escape character here

    3
    0 Votes
    3 Posts
    326 Views
    mpheathM

    @PeterAdam

    The styling looks like the SQL lexer (for SQLite3,…) which is not the correct lexer for T-SQL. The @variables are not colored as they should. Problems with escapes…

    From the Language menu, select the Microsoft Transact-SQL lexer and you may see

    t-sql.png

    Should I try to edit the langs.xml file?

    The langs.xml file in %AppData%\Notepad++ may need updating if Microsoft Transact-SQL is not in the menu. Compare it with langs.model.xml that is in %ProgramFiles%\Notepad++ .

  • Request for Comment from Regulars: Forum Reputation Limit

    13
    5 Votes
    13 Posts
    2k Views
    EkopalypseE

    @PeterJones

    I’m team Option1 as well :-D

  • 0 Votes
    5 Posts
    687 Views
    mkupperM

    @FlavioB said in New Install - How to get open files list from old install...:

    Does this work/apply also for all the open files which have not been saved anywhere yet?

    The session.xml file has all of the tabs including the ones named “new #” where # is a number.

    By default, Notepad++ backs up all tabs/files you are working on every 7 seconds into the backup folder.

    Look at @Terry-R’s reply to you as that link is to an article both finding your old session.xml file and Notepad++'s backup folder.

  • Unicode problem !

    12
    1 Votes
    12 Posts
    712 Views
    CoisesC

    @guy038 said in Unicode problem !:

    But, nowadays, with the Unicode standard and the universal UTF-8 encoding, I suppose that any computer language should handle these Unicode chars properly !

    TLDR: Unicode is hard.

    You know the joke that goes, “There’s a sort of person who sees a problem and thinks, ‘I know! I’ll use regular expressions!’ Now that person has two problems.”? One could say the same of Unicode.

    Modern Windows is natively Unicode… but it’s UTF-16. Nearly everything else (including Scintilla) that uses Unicode does it as UTF-8.

    And most programming languages — as well as most regular expression implementations! — think of “characters” as fixed-length entities in memory. By choosing UTF-16, Windows at least makes handling the Basic Multilingual Plane fairly straightforward, so long as you don’t mind converting nearly everyone else’s version of Unicode to Windows’ version. OK for short strings… not so good when you have megabytes or gigabytes of file data.

    C++ had some limited Unicode-related functions in its standard library, but has now deprecated even those and just says one should use an appropriate library.

    Even if you’re willing to convert to UTF-32 (which means quadrupling the storage requirements of ASCII characters), so that every Unicode code point is the same size in memory, not all Unicode characters are a single Unicode code point. The complexity just keeps increasing, and increasing… the hope that Unicode would “simplify” using all the world’s scripts has not exactly been realized.

    When I wanted to incorporate Boost.Regex directly into my Columns++ plugin, I first thought to use its Unicode facilities. Then I saw that while Boost.Regex is a header-only library (if you don’t know C++, read that as “easy to include in a project without changing the way the project is structured”), its Unicode facilities require ICU4C — and if there’s any simple, straightforward way to incorporate that monstrosity into an otherwise simple, straightforward project, I couldn’t find it. I settled for the same “hack” that Notepad++ itself uses: convert UTF-8 to UTF-16 on the fly, use Windows’ support of UTF-16 where needed, and let the chips fall where they may for anyone bold enough to use combining characters or characters outside the basic multilingual plane.

    Unicode is so complex, so full of details (What characters are “the same” when you ignore case? Well, that depends on the current locale…), that support is a project in itself, and attempts to be reasonably complete (ICU) are gigantic and constantly being updated.

  • 3 Votes
    21 Posts
    9k Views
    PeterJonesP

    @PeterJones said in Guide: How to correctly check for available Notepad++ updates using your web browser::

    Yeah, I would vote for “FAQ” rather than “FAQ Desk” too. And I’m the one who started the “FAQ Desk” nomenclature. I originally thought it was a good idea, especially when there was no FAQ category, to indicate that this was the answer to the FAQ (“you’ve been sent to the FAQ Desk to find the answer to your question…”). But in the intervening time, I’ve liked that nomenclature less.

    And yet, 4.5 years later, I still hadn’t changed those prefixes. But I finally found the elusive Round Tuit™ today, so all the FAQ entries are now listed as “FAQ: …” rather than “FAQ Desk: …”

    And while I haven’t renamed the section, I am perfectly happy to put Guide-like entries into the FAQ (and looking back over the entries, many of the historical FAQ entries really are more of a guide than an answer to a single Frequently Asked Question).