Set default encoding for file open

Set default encoding for file open

5

    Jul 17, 2017#1

    Hi!

    I'm automatically saving my files as UTF-8, but when I open them, the default encoding always seems to be 1252 ANSI Latin I. Can I change this so all my files default to UTF-8 when opening?

    My UltraEdit version is: 20.00.0.1054

    Thank you!

    79
    Advanced UserAdvanced User
    79

      Jul 17, 2017#2

      I think the configuration dialog at "File handling | Encoding" should allow you to specify the default encoding to be UTF-8.

      6,602548
      Grand MasterGrand Master
      6,602548

        Jul 18, 2017#3

        In UltraEdit v20.00.0.1054 open Advanced - Configuration - File Handling - Unicode/UTF-8 Detection and make sure the configuration setting Auto detect UTF-8 files and best also Detect Unicode (UTF-16 files without BOM) are both enabled. The other two settings in this configuration dialog are usually unchecked because not needed whereby the last one unchecked saves some time on loading a file.

        The encoding for new files can be set at Advanced - Configuration - Editor - New File Creation where you have to select Create new files as UTF-8.

        The first two settings at Advanced - Configuration - File Handling - Save determine if UTF-8 files are by default saved without or with BOM if not selecting in File - Save As dialog a different encoding.

        UTF-8 files containing only ASCII characters, i.e. characters with a code value smaller than 128 decimal, saved without byte order mark are binary equal to ANSI encoded file containing only ASCII characters. For that reason UltraEdit and any other application cannot automatically detect if the file should be interpreted as UTF-8 or as ANSI encoded file.

        There is also the setting Force UTF-8=1 which can be manually added to uedit32.ini respectively uedit64.ini in directory %APPDATA%\IDMComp\UltraEdit with Windows Notepad while UltraEdit is not running in section [Settings] to interpret all non UTF-16 encoded files automatically as UTF-8 encoded files. But be aware that with this setting you must use File - Open and explicitly select ASCII/ANSI encoding when an ASCII/ANSI encoded file must be opened in UltraEdit. For more details on this special setting forcing single byte encoded text files to be interpreted as UTF-8 encoded files read the forum topics UTF-8 not recognized, largish file and Using UTF-8 with UltraEdit.
        Best regards from an UC/UE/UES for Windows user from Austria

        5

          Jul 19, 2017#4

          Thank you!

          My setting are all as Mofi described. It made me wonder if these files were really saved as ANSI instead of UTF-8.

          Just saving them as UTF-8 didn't seem to work, but creating a new UTF-8 doc, pasting the code into it and saving over the file seemed to work.

          Not the end of the world, but a nuisance just the same.

          Thank you both again for your input.

          6,602548
          Grand MasterGrand Master
          6,602548

            Jul 19, 2017#5

            Please note that when you have once in the past manually selected a different code page / encoding for an active file from what was automatically detected by UltraEdit, UltraEdit remembers this setting for this specific file in its INI file. So the user has not to manually set the code page / encoding once again on opening this specific file again in a future UltraEdit editing session.

            Close UltraEdit project or all open files, open Advanced - Settings or Configuration - Toolbars / Menus - Miscellaneous, click on button Clear history which clears all histories including the file specific code page history, click on button Cancel and exit UltraEdit. Restart UltraEdit and reopen the files or project.

            There is no built-in support for clearing a specific history only. This must be done with Windows Notepad by editing the INI file while UltraEdit is not running if really wanted to be done. The section to delete is [File Code Page].
            Best regards from an UC/UE/UES for Windows user from Austria