Re: Tutorial: Notepad++ shortcuts.xml macro converts unicode to the 95-keyboard ASCII characters
Marian <[email protected]> Wed, 31 Dec 2025 01:33:28 -0700
| Newsgroups | alt.comp.os.windows-10,alt.comp.os.windows-11,alt.comp.microsoft.windows |
|---|---|
| Organization | BWH Usenet Archive (https://usenet.blueworldhosting.com) |
| Message-ID | <[email protected]> |
Marian wrote:
> Tutorial:
> Notepad++ shortcuts.xml macro converts unicode to the 95-keyboard ASCII characters
While this thread is about using Notepad++ to "selectively" convert
any given funky character to any other given ASCII character,
another way to convert Unicode to ASCII could be the following scripts.
c:\> type unicode.txt
This line is fine.
This line has a sneaky Unicode dash û right here.
This line has curly quotes ôlike theseö.
This line has a non-breaking space between words.
c:\> type unicode2ascii.bat
@echo off
:: unicode2ascii.bat
:: This batch file runs a PowerShell script that removes all non-ASCII
:: characters from unicode.txt and writes the cleaned output to ascii.txt.
powershell -NoProfile -ExecutionPolicy Bypass -File unicode2ascii.ps1
c:\> type unicode2ascii.ps1
# unicode2ascii.ps1
# This script reads unicode.txt, removes all characters outside the
# 7-bit ASCII range (0x00 to 0x7F), and writes the result to ascii.txt.
Get-Content unicode.txt | ForEach-Object {
($_ -replace '[^\x00-\x7F]', '')
} | Set-Content ascii.txt
c:\> type ascii.txt
This line is fine.
This line has a sneaky Unicode dash right here.
This line has curly quotes like these.
This line has a non-breaking space between words.
--
Just paying it forward with clear steps & free tools made simple.