UTF-8 without BOM and no CR/LF LF conversions

General and specific configuration/INI settings

UTF-8 without BOM and no CR/LF LF conversions

Postby uwoiame » Thu Nov 23, 2006 4:06 pm

Here is my problem:

I have to remove the BOM code from UTF-8 text files.
In UltraEdit I tried doing this by removing the 3 bytes using hex edit mode. So far so good.
Then I tried saving this file as UTF-8 without BOM.

The problem now is that the files contain a mix of CR/LF (0d0a) and LF (0a) which have to be kept that way. Saving the file however seems to either convert them to all CR/LF (windows) or all LF (Unix).

Is there a way to disable this CR/LF LF conversion?
User avatar
uwoiame
Newbie
 
Posts: 1
Joined: Thu Nov 23, 2006 12:00 am

Re: UTF-8 without BOM and no CR/LF LF conversions

Postby Mofi » Fri Nov 24, 2006 6:24 pm

The easiest method to remove the UTF-8 BOM in your special case is to do it without opening the files. This can be done with a normal, non regular expression Replace In Files. You can do this by searching for  (= UTF-8 BOM) and replace it with nothing.

If you really want to edit files with mixed usage of CRLF and only LF as I was forced also in the past as I needed to edit some Opera M2 mail storage files (*.mbs) you can do this also with UltraEdit. But you have to uncheck everything at Configuration - File Handling - Unicode/UTF-8 Detection and set the config option UNIX/MAC file detection/conversion at DOS/UNIX/MAC Handling to value Disable.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4056
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Configuration/INI Settings