Windows .reg file modification problems

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
dforrest
Posts: 44
Joined: Mon Jan 19, 2004 11:19 pm
Location: St. Vincent and the Grenadines

Windows .reg file modification problems

Post by dforrest »

I am having problems modifying a Windows registry script file (*.reg file) in TextPad 7.6.1.

When I try to run the modified .reg file I get the message "Cannot import D:\MSTS_Swap\MSTS_Swap_Data\RR_REG_File.reg: The specified file is not a registry script. You can only import binary registry files from within the registry editor".

Can someone please assist.
ben_josephs
Posts: 2457
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Windows registry files are Unicode, encoded in UTF-16LE (what TextPad 7 calls simply Unicode) with BOM. If you open an existing registry file in binary format, you will see that it begins with FF FE.

In TextPad 7:

Select Configure | Preferences | Document Classes | <Class> | Write Unicode and UTF-8 BOM
or View | Document Properties | Preferences | Write Unicode and UTF-8 BOM
and save the file using
File | Save As... | Encoding: Unicode
dforrest
Posts: 44
Joined: Mon Jan 19, 2004 11:19 pm
Location: St. Vincent and the Grenadines

Post by dforrest »

Thank you. I thought that TextPad automatically save a files in the same format as the original file. Is this not so?
Lawrence
Posts: 9
Joined: Wed Sep 01, 2004 3:32 pm
Location: Kansas City

Post by Lawrence »

I just came across a solution which utilizes a new document class for editing Windows registry files. See https://textpadregistryfile.wordpress.c ... -solution/ for complete details. Now why did this take me 10+ years to find a solution, the one presented in this thread or the link above?
User avatar
Verayth
Posts: 2
Joined: Tue Jan 26, 2016 4:39 pm

Post by Verayth »

I don't care about Unicode characters or support, so the easiest solution for me has always been to just to re-save the reg file as ASCII. I've been doing this for many years, and they load just fine.
Lawrence
Posts: 9
Joined: Wed Sep 01, 2004 3:32 pm
Location: Kansas City

Post by Lawrence »

Verayth wrote:I don't care about Unicode characters or support, so the easiest solution for me has always been to just to re-save the reg file as ASCII. I've been doing this for many years, and they load just fine.
How do you do that in TextPad 7? Is ANSI the same as ASCII? The choices I have are ANSI, DOS, UTF-8, UTF-16 and UTF-16BE.
User avatar
woho
Posts: 100
Joined: Tue Sep 02, 2003 9:12 am
Location: Steyr/Austria
Contact:

Post by woho »

I used to save my *.reg files as 'DOS' and it worked
MeepoRatbagger
Posts: 7
Joined: Tue Aug 09, 2016 12:07 pm

Post by MeepoRatbagger »

Lawrence wrote:How do you do that in TextPad 7? Is ANSI the same as ASCII? The choices I have are ANSI, DOS, UTF-8, UTF-16 and UTF-16BE.
Technically, no. ASCII refers to the 7-bit character set containing printable characters 32 [space] to 126 [tilde]. ANSI commonly refers to an 8-bit character set such as Windows-1252.

The ASCII characters all have the same encoding between ASCII, Windows-1252 (and most other 8-bit character sets) and UTF-8, but characters with codes above 127 differ.

Try saving files with different characters in the various formats and opening them in Binary Mode to see what's really there.
"To err is human; to purr, feline."
Post Reply