#!/usr/bin/perl use strict; use warnings; my ($log_qfn) = $ARGV[0] or die("usage"); # Encode output. # Use the encoding that's appropriate for you. binmode STDOUT, ':encoding(UTF-8)'; my $lines; { # Decode input. open my $log_fh, "<:encoding(UCS-2le)", $log_qfn or die($!); local $/ = undef; $lines = <$log_fh>; $lines =~ s/\x{FEFF}//g; } print(length($lines), "\n"); print($lines);
1291 -------------------- BackupSet Number :21 -------------------- User name bruce_benson Backup Operation : Scheduled Version No: 3.2.6 Total backup set size 42.46 MB [ 05-22-2009 04:01:08 ] [Incremental Backup]Backed up file T:\Quicke +nw\BENSONS.QPH, 3.26 MB [ 05-22-2009 04:01:25 ] [Incremental Backup]Backed up file T:\Quicke +nw\BENSONS.IDX, 4.17 MB [ 05-22-2009 04:01:33 ] [Incremental Backup]Backed up file T:\Quicke +nw\BENSONS.QEL, 4.43 MB [ 05-22-2009 04:01:36 ] [Incremental Backup]Backed up file T:\Passwo +rdSafe\passwordsafe.dat, 26.46 KB [ 05-22-2009 04:01:40 ] [Incremental Backup]Backed up file T:\Quicke +nw\BENSONSOFXLOG.DAT, 203.61 KB [ 05-22-2009 04:02:59 ] [Incremental Backup]Backed up file T:\Quicke +nw\BENSONS.QDF, 30.37 MB BACKUP START TIME : 05-22-2009 04:01:04 BACKUP END TIME : 05-22-2009 04:03:00 Total Time : 00:01:56 Number of files considered for Backup: 13 file(s) Number of files found to be in sync : 7 file(s) Backup Completed [Backed up Files : 6 of 6] Please note, from your selected backupset, the below listed file(s)/fo +lder(s) have been excluded from backup in the 'Backup' pane under Too +ls-->preferences: C:\Documents and Settings\Bruce\My Documents\ C:\Documents and Settings\Bruce\Desktop\

In reply to Re^4: Problems Handling UCS-2LE by ikegami
in thread Problems Handling UCS-2LE by Ecurb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.