Tapatalk

New file with UTF-8 encoding and Unix line terminator

New file with UTF-8 encoding and Unix line terminator

2
NewbieNewbie
2

    Apr 24, 2009#1

    I would like all my files in UTF-8 encoding and have Unix line terminators. Even if I create a new file. Is that possible? If so, how?

    6,685587
    Grand MasterGrand Master
    6,685587

      Apr 25, 2009#2

      For UltraEdit for Windows v16.00 and later versions:

      Open Advanced - Configuration and
      • select Create new files as UTF-8 at Editor - New File Creation,
      • select Unix at File Handling - DOS/UNIX/MAC Handling - Default file type for new files,
      • configure the UTF-8 BOM settings like you want it at File Handling - Save.
      Close the configuration dialog with button OK and that's it.

      For UltraEdit for Windows v15.20 and previous versions:

      Open Advanced - Configuration and
      • enable Editor - New File Creation - Create new files as Unicode,
      • select Unix at File Handling - DOS/UNIX/MAC Handling - Default file type for new files and
      • select Disable for UNIX/MAC file detection/conversion in the same configuration dialog,
      • enable File Handling - Conversions - On Paste convert line endings to destination type (UNIX/MAC/DOS),
      • configure the UTF-8 BOM settings like you want it at File Handling - Save.
      Close the configuration dialog with button OK.

      On first save of a new file with the Save As dialog, select for Format either UTF-8 or UTF-8 NO BOM. This setting is remembered and always used when saving a file with Save As as it is done for new files, even from within macros or scripts. As long as you do not change this setting your new files are created as Unicode UTF-16 LE files with Unix line endings and are converted to UTF-8 on first save.


      But in my point of view it is better to work on Windows with DOS line endings and not with Unix line endings. That makes finds/replaces with line endings, macros, scripts and text exchange via Windows clipboard with other applications easier. If your files are normally not very large and you work with temporary files, it would be better to select DOS for Default file type for new files and specify in the Save As dialog Unix as line terminator. This setting is also remembered and therefore all your new files are converted to use Unix line endings on first save. Additionally you have to select Automatically convert to DOS format for UNIX/MAC file detection/conversion and enable also Save file as input format (UNIX/MAC/DOS). Now all your Unix files are automatically converted to DOS on file load and converted back to Unix on file save. That gives you 100% compatibility with all the other Windows applications.
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Apr 27, 2009#3

        Thanks for the help.