Just compiling all the answers together with some extra info I discovered.
Header on the first line:
Windows Registry Editor Version 5.00
- A blank line between keys delimited by "CRLF"
- keys brackets without spaces
- values in double quotes
- integer/word values in hex - lowercase for the letters apparently
Example
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\MyOrg]
[HKEY_LOCAL_MACHINE\SOFTWARE\MyOrg\MyKey]
"My Value"="Some String"
"My Flag or Integer"=dword:00000001
The allowed encodings also seems to correspond to the Windows API strings which are:
- 8-bit fixed width: Windows-1252 - almost the same as ISO-8859-1
- 16-bit fixed width: UCS-2LE (little endian) - basically the same as UTF-16
Note: when a text editor says "unicode" for the encoding, it probably means UTF-8 which is a variable width encoding not naively compatible with internal Windows.
Note 2 (edit): ASCII is 7-bit and all the processors I know of in use are a power of 2 bits so it's always going to be wrapped in some other ASCII superset like 1252. #thingsyoulearnafteruni