Brimbox Logo Brimbox Version 2.3.4 Released

Character Policy>>

Since Brimbox stores all of its data as characters in text (or character) fields, it has a unwanted character policy. There is a simple process for unwanted characters default. The policy follows:

  1. For Regular fields Line Feeds, Returns, Tabs, Vertical Tabs, Form Feeds, and Nulls are greedily converted to spaces and the string is trimmed. Greedily here means if there are two or more control characters consecutively it becomes one space.
  2. In Note fields, Returns, Tabs, Vertical Tabs, Form Feeds, and Nulls are also greedily replaced with spaces. Line Feeds are kept, but the spaces around Line Feeds are purged, so a Line Feed in a note will always be attached to a trimmed string. So a Note contains trimmed strings separated with Line Feeds.

The only remaining control character is the Line Feed in the Note field. Consider that Internet Explorer will actually write carriage returns to Brimbox and Brimbox will remove them each time before updating or inserting into the database. Internet Explorer will display solo Line Feeds as new lines.

Note these routines use this algorithm or purge tabs:

  • Character policy is enforced with the $main->purge_chars() method when entering and updating data using the standard input routines.
  • The “Clean Database Data” button on the “Backup and Restore” admin menu uses this policy through the $main->cleanup_database_data() method.
  • When creating backups using the “Backup Database” on the “Backup and Restore” admin menu tabs are purged from data fields. Tabs are used as field delimiters so they will corrupt a backup.

The $main->purge_chars() method also contains an option for removing double quotes but they are not banned from the database data_table.

Postgres will not allow null characters in text (or character fields) so that character is not addressed in the “Clean Database Data” routine/$main->cleanup_database_data() method.

Note that backup and export routines add a CRLF to the end of database rows. This is standard for Brimbox.

Updated: 2017-07-22

Documents

Definitions