4D Blog

Home Product Invisible Characters on Stage!

Invisible Characters on Stage!

July 20, 2021

Product

Best practices in IT sometimes change, and the management of certain invisible characters in text files is one example. End of Line (EOL) characters have evolved, especially for version control systems integration purposes. In the same way, the Byte Order Mark (BOM) on Unicode text files is less and less used.

With 4D v19 R2, 4D has evolved smoothly to follow these best practices, giving you more flexibility along the way.

REMINDER

End of line (EOL)

You know that lines in text files are separated with End of Line character(s). On Windows, it’s a combination of two characters:

  • Carriage Return (#13, named CR) and,
  • Line Feed (#10, named LF).

On macOS, it was the legacy CR character.

Version control systems like Git don’t manage CR as EOL character, so there’s a need to use LF instead.

Byte Order Mark (BOM)

You also know that a Unicode text file can contain invisible heading bytes, named Byte Order Mark, that define the character set used.

4D followed the current best practices when introducing Unicode, by writing text files with a BOM by default. But as UTF-8 has nearly become the standard text file format, the BOM is less and less used.

NEW 4D convention ON TEXT FILES

From now on, following the trends, 4D writes text files without a BOM. And on macOS, 4D uses LF as EOL character. This is completely automatic for all files written by 4D, such as 4DSettings, 4dm, 4DForm, and so on.

When opening files in a previous 4D version, you won’t encounter any problem, even if they were written in 4D v19 R2, because these previous versions were able to open files without BOM and using LF as EOL character.

Compatibility settings

Want to follow 4D’s behavior? New compatibility settings are available that allow TEXT TO DOCUMENT and File.setText() to generate files without a BOM and use LF as EOL character on macOS when the optional “charSet” and “breakMode” parameters are missing. This is fully automatic; you don’t need to rewrite your source code to benefit from this new behavior.

NEW CHARACTER SETS

The new compatibility settings apply to the commands TEXT TO DOCUMENT and File.setText() when they are used without the “charSet” or “breakMode” optional parameters.
No changes were made for the EOL character. It can still be forced using the “breakMode” parameter.

In the same way, you may want to define precisely if the files generated by TEXT TO DOCUMENT and File.setText() contain a BOM or not. To do this, define a Unicode character set ending with “-no-bom”, such as “UTF-8-no-bom” or “UTF-16-no-bom”,  to write a file without a BOM. To write a file with a BOM, you can still use the existing character sets without the suffix “-no-bom”, such as “UTF-8” or “UTF-16”.

Discuss

Tags Compatibility settings, Programming, v19 R2, v20

Latest related posts

  • April 29, 2025

    Discover your AI-powered writing assistant in 4D Write Pro

  • April 28, 2025

    Unlock the Power of AI with 4D AIKit: Automate, Create, and Innovate

  • April 25, 2025

    Formulas in Label Wizard

Avatar
Damien Fuzeau
• Product Owner •Damien Fuzeau has joined the 4D Product team in February 2019. As a Product Owner, he is in charge of writing user stories, then translating them to functional specifications. His job also entails making sure that the feature implementations delivered are meeting the customer needs.Damien is graduated from the University of Nantes in software engineering. He spent more than 23 years in its former company, first as developer (discovering 4D in 1997), and later as engineering manager and software architect. This company is a 4D OEM partner and deployed 4D based business softwares for thousands users, on hundreds servers. So, Damien is used to 4D development and deployment in a multi-language context.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy