Difference between revisions of "File page"
(19 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <noinclude>{{manversion| | + | <noinclude>{{manversion|6.0.0.17|dialog|Settings:File}}__NOTOC__</noinclude> |
− | ====Default encoding==== | + | ===={{field|Settings:File|Default encoding}}==== |
− | The {{field|Default encoding}} specifies | + | The '''{{field|Settings:File|Default encoding}}''' setting specifies default |
+ | {{feature|Encoding}} to be used for new documents, or in cases where detection of encoding of a file being loaded is indecisive (e.g. if loading pure ASCII file, encoding can be both ANSI and UTF-8). | ||
− | + | Supported default encodings are: | |
+ | * '''{{field|Settings:File|Default encoding: ANSI}}''', which depends on the System default code page. | ||
+ | * '''{{field|Settings:File|Default encoding: UTF-8}}''', which can include or exclude {{defined|BOM}}. | ||
+ | * '''{{field|Settings:File|Default encoding: Unicode}}''', which should always include {{defined|BOM}}. | ||
+ | * '''{{field|Settings:File|Default encoding: Big Endian}}''', which should always include {{defined|BOM}}. | ||
− | + | The '''{{field|Settings:File|Default encoding: Add BOM (UTF-8 / Unicode)}}''' setting extends some encodings with {{defined|BOM}} and non-{{defined|BOM}} variants. Note: While some encodings do not allow {{defined|BOM}} at all (e.g. ANSI), other encodings recommend using {{defined|BOM}} (e.g. both Unicodes), and some encodings make {{defined|BOM}} optional (e.g. UTF-8). | |
− | + | '''Important note:''' If {{defined|BOM}} is recommended for some encoding, omitting it is allowed, but might result in inability to auto-detect correct file encoding upon future file loading. This is especially true with Unicode files. See {{feature|Open File}} for further details about encoding auto-detection and available workarounds. | |
− | + | ===={{field|Settings:File|Default newlines}}==== | |
− | + | The '''{{field|Settings:File|Default newlines}}''' setting specifies default type of {{feature|Newlines}} to be used for new documents, or in cases where detection of newlines of a file being loaded is indecisive (e.g. if loading file with no newlines). | |
− | + | Supported types of default newlines are: | |
+ | * '''{{field|Settings:File|Default newlines: Windows}}''', i.e. {{string|CR/NL}}, i.e. {{string|13 10}} in ASCII, i.e. {{string|0D 0A}} in hex. | ||
+ | * '''{{field|Settings:File|Default newlines: Unix}}''', i.e. {{string|NL}} only, i.e. {{string|10}} in ASCII, i.e. {{string|0A}} in hex. | ||
+ | * '''{{field|Settings:File|Default newlines: Mac}}''', i.e. {{string|CR}} only, i.e. {{string|13}} in ASCII, i.e. {{string|0D}} in hex. | ||
− | + | See {{feature|Newlines}} for further details on when and how | |
+ | {{feature|Newlines}} are used within TED Notepad. | ||
− | ==== | + | ===={{field|Settings:File|Dialogs}}==== |
− | The {{field|Default | + | The '''{{field|Settings:File|Default file type}}''' setting specifies, what file extension is to be used by default in the {{feature|Save As}} dialog, if no file extension is specified explicitly. This default file extension may not exceed 4 characters. |
− | + | {{tip}} The default file extension for plain-text documents is {{string|txt}}, but users may choose to override this with another value. For example, use {{string|html}}, if creating HTML documents more often than plain-text files. | |
− | + | The '''{{field|Settings:File|Default path}}''' setting defines relative or absolute path, which is to be used as a starting point in the {{dialog|Open}} and {{dialog|Save As}} dialogs. | |
+ | * If no path is specified as {{field|Settings:File|Default path}}, the current working directory is used if it contains files which satisfy the {{field|Settings:File|Filter strings}} patterns described below. Otherwise, personal files directory of the current user is used as starting point. | ||
+ | * If absolute path is specified, it is used unmodified in all cases. | ||
+ | * If relative path is specified (e.g. {{string|.}} or {{string|\docs}}), it refers to current working directory. Note: The current working directory is usually the directory which TED Notepad was started from; although shortcuts allow to specify another starting directory for example. Also note that the current working directory no longer changes with every {{dialog|Open}} and {{dialog|Save As}} dialog operations as it did in previous versions of TED Notepad. The current working directory stays the same throughout the entire instance session. | ||
− | {{tip}} A useful example for portable usage is | + | {{tip}} A useful example for portable usage is simple back-slash ({{string|\}}) as {{field|Settings:File|Default path}}, which makes the {{dialog|Open}} and {{dialog|Save As}} dialogs start in the root directory of the drive, from which you originally launched the application. This can be used to twist the USB drive around, while moving TED Notepad on the USB drive from one computer to another. |
− | + | Note: One of the requirements for this to work, is to use correct working directory upon launching TED Notepad from the USB drive. In most typical cases, the system uses the USB drive as the working directory (as expected). However, some file managers and portable launchers may need to be told what working directory to use explicitly. Set them to use the USB drive. | |
− | The {{field|Filter strings}} | + | The '''{{field|Settings:File|Filter strings}}''' setting define filters, which are to be used in the {{dialog|Open}} and {{dialog|Save As}} dialogs as file filters. These filters appear in a combo-box, usually bellow the file name box. A filter consists of two {{defined|strings}} separated by Pipe character ({{string|<nowiki>|</nowiki>}}). |
− | The first {{defined|string}} in a filter is a name to be displayed | + | The first {{defined|string}} in a filter is a name to be displayed, which describes the filter (e.g. {{string|Text Files}}). The second one specifies a filtering pattern (e.g. {{string|*.txt}}). A filter for text files could look like {{string|Text Files<nowiki>|</nowiki>*.txt}} or {{string|Text Files (*.txt)<nowiki>|</nowiki>*.txt}}. |
− | To specify multiple filtering patterns for | + | To specify multiple filtering patterns for single filter, use semicolon to separate the patterns (e.g. {{string|*.txt;*.doc;*.bak}}). Filtering pattern can be a combination of valid filename characters and an asterisk wildcard character. Do not include spaces in the pattern {{defined|string}}. |
− | Several filters are to be delimited | + | Several filters are to be delimited by a Pipe character ({{string|<nowiki>|</nowiki>}}). Therefore {{field|Settings:File|Filter strings}} value should eventually consist of pairs of {{defined|strings}} delimited by Pipe characters. Each pair defines one filter: a name and its filtering pattern. |
− | + | Example: Default filters are {{string|<nowiki>Text Files (*.txt)|*.txt|All Files|*.*</nowiki>}} | |
− | The {{field|Suggest first line as new file name}} | + | The '''{{field|Settings:File|Suggest first line as new file name}}''' setting specifies, whether text from the first non-empty line of the document is to be suggested in the {{dialog|Save As}} dialog as a new file name instead of the default {{string|Untitled}}. |
− | + | Note: Characters unallowed in file names are automatically converted into dashes. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | Note: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 00:02, 5 October 2021
Control page Control:dialog:Settings:File
Default encoding
The Default encoding setting specifies default Encoding to be used for new documents, or in cases where detection of encoding of a file being loaded is indecisive (e.g. if loading pure ASCII file, encoding can be both ANSI and UTF-8).
Supported default encodings are:
- Default encoding: ANSI, which depends on the System default code page.
- Default encoding: UTF-8, which can include or exclude
BOM
. - Default encoding: Unicode, which should always include
BOM
. - Default encoding: Big Endian, which should always include
BOM
.
The Default encoding: Add BOM (UTF-8 / Unicode) setting extends some encodings with BOM
and non-BOM
variants. Note: While some encodings do not allow BOM
at all (e.g. ANSI), other encodings recommend using BOM
(e.g. both Unicodes), and some encodings make BOM
optional (e.g. UTF-8).
Important note: If BOM
is recommended for some encoding, omitting it is allowed, but might result in inability to auto-detect correct file encoding upon future file loading. This is especially true with Unicode files. See Open File for further details about encoding auto-detection and available workarounds.
Default newlines
The Default newlines setting specifies default type of Newlines to be used for new documents, or in cases where detection of newlines of a file being loaded is indecisive (e.g. if loading file with no newlines).
Supported types of default newlines are:
- Default newlines: Windows, i.e. CR/NL, i.e. 13 10 in ASCII, i.e. 0D 0A in hex.
- Default newlines: Unix, i.e. NL only, i.e. 10 in ASCII, i.e. 0A in hex.
- Default newlines: Mac, i.e. CR only, i.e. 13 in ASCII, i.e. 0D in hex.
See Newlines for further details on when and how Newlines are used within TED Notepad.
Dialogs
The Default file type setting specifies, what file extension is to be used by default in the Save As dialog, if no file extension is specified explicitly. This default file extension may not exceed 4 characters.
Tip: The default file extension for plain-text documents is txt, but users may choose to override this with another value. For example, use html, if creating HTML documents more often than plain-text files.
The Default path setting defines relative or absolute path, which is to be used as a starting point in the Open and Save As dialogs.
- If no path is specified as Default path, the current working directory is used if it contains files which satisfy the Filter strings patterns described below. Otherwise, personal files directory of the current user is used as starting point.
- If absolute path is specified, it is used unmodified in all cases.
- If relative path is specified (e.g. . or \docs), it refers to current working directory. Note: The current working directory is usually the directory which TED Notepad was started from; although shortcuts allow to specify another starting directory for example. Also note that the current working directory no longer changes with every Open and Save As dialog operations as it did in previous versions of TED Notepad. The current working directory stays the same throughout the entire instance session.
Tip: A useful example for portable usage is simple back-slash (\) as Default path, which makes the Open and Save As dialogs start in the root directory of the drive, from which you originally launched the application. This can be used to twist the USB drive around, while moving TED Notepad on the USB drive from one computer to another.
Note: One of the requirements for this to work, is to use correct working directory upon launching TED Notepad from the USB drive. In most typical cases, the system uses the USB drive as the working directory (as expected). However, some file managers and portable launchers may need to be told what working directory to use explicitly. Set them to use the USB drive.
The Filter strings setting define filters, which are to be used in the Open and Save As dialogs as file filters. These filters appear in a combo-box, usually bellow the file name box. A filter consists of two strings
separated by Pipe character (|).
The first string
in a filter is a name to be displayed, which describes the filter (e.g. Text Files). The second one specifies a filtering pattern (e.g. *.txt). A filter for text files could look like Text Files|*.txt or Text Files (*.txt)|*.txt.
To specify multiple filtering patterns for single filter, use semicolon to separate the patterns (e.g. *.txt;*.doc;*.bak). Filtering pattern can be a combination of valid filename characters and an asterisk wildcard character. Do not include spaces in the pattern string
.
Several filters are to be delimited by a Pipe character (|). Therefore Filter strings value should eventually consist of pairs of strings
delimited by Pipe characters. Each pair defines one filter: a name and its filtering pattern.
Example: Default filters are Text Files (*.txt)|*.txt|All Files|*.*
The Suggest first line as new file name setting specifies, whether text from the first non-empty line of the document is to be suggested in the Save As dialog as a new file name instead of the default Untitled.
Note: Characters unallowed in file names are automatically converted into dashes.