DelphiDabbler CodeSnip
File Format Documentation

Test Units

Introduction

CodeSnip saves temporary test units that are valid Pascal unit. These units are used to perform test compiles.

There is no specific file format for these files, other than they are valid Object Pascal source code.

Encoding

The encoding used for test units depends on the content of the unit.

If the unit's source code contains only characters that are supported by the system default ANSI code page the file is saved using the default ANSI encoding.

If the source code contains one or more characters that cannot be represented in the default ANSI code page then the file is saved as UTF-8, with byte order mark.

Note that files are saved using the ANSI default encoding if possible because earlier versions of Delphi cannot read UTF-8 encoded files and do not support Unicode characters in the source code. Versions of Delphi that permit Unicode characters in source code can read UTF-8 source files.

Unit filenames are limited to ANSI characters again for reasons of compatibility with earlier Delphis because they will report Unicode file names as "not found".