PrestoSoft Blog :: Home

Wednesday, February 17, 2010

Split Diff Blocks

Sometimes diff blocks that are labeled as "changed" between two files can be better expressed as an "added" block followed by a "deleted" block. For example, in the diff block shown below, the part in the left file and the part in the right file are entirely different pieces of code:



It can be unsightly and confusing to have such blocks be labeled as "changed", and for this reason we're introducing a Split Block command in the upcoming version 5.0. Here's how it works: right-click within a changed block and select Split Block from the context menu, and the block is split into two separate diff blocks, as shown below.





Note that the order of the resulting blocks depends on whether you select the command from the left pane or the right pane, so right-clicking on the right side and selecting Split Block will result in the deleted block coming first:





Splitting blocks can be especially helpful when you are preparing an HTML diff report for somebody else and you want the differences to be displayed as clearly as possible. In this situation, you may also want to fine-tune fuzzy matching settings and/or use manual synchronization to ensure that all lines within changed blocks are aligned precisely.

In addition to making the difference clearer to see, this feature is useful if you need to copy a changed block while keeping the destination block intact: you can split the block, and then use synchronization buttons to copy a newly created deleted or added block. Note that this is equivalent to using the Add Block from First/Second File to Second/First commands.

Labels: , ,

Wednesday, February 03, 2010

Detecting Unicode Files Without BOMs

ExamDiff Pro 5.0 will add the ability to detect Unicode files without byte order marks (BOMs).

Until these changes Unicode (UTF-16) files were detected by BOMs (0xFFFE for little endian and 0xFEFF for big endian). However, some Unicode files unfortunately lack BOMs, and ExamDiff Pro will now be able to properly deal with such files, by attempting to determine the file's encoding based on an analysis of the file contents.

Note that ExamDiff Pro 4.5 already includes a feature to force Unicode encoding for files without BOMs: the Open buttons in the Compare dialog allow you to manually select file encoding rather than have it be automatically detected, as shown below. Even in version 5.0, this will still remain a useful feature for cases in which you know the intended encoding for a file without a BOM, because it ensures that the files are detected properly.

Labels: , ,