Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Problem with larger files (and s/)

by moritz (Cardinal)
on Jun 24, 2008 at 22:12 UTC ( #693834=note: print w/replies, xml ) Need Help??

in reply to Problem with larger files (and s/)

open(IN, $sqlfile) || die "cannot open $sqlfile for input: $!"; open(OUT, ">$outfile") || die "cannot open $outfile for output: $!";

If you are sure that the files are all ASCII, try this instead:

open(IN, '<:encoding(ASCII)', $sqlfile) or die "cannot open $sqlfile f +or input: $!"; open(OUT, '>:encoding(ASCII)', $outfile or die "cannot open file $outf +ile for writing: $!";

Are you really sure that the files are in ASCII? which editor did you open it with? Try to inspect the files with a hex editor/dumper and see if it's really ASCII.

Replies are listed 'Best First'.
Re^2: Problem with larger files (and s/)
by Cloudster (Novice) on Jun 25, 2008 at 14:51 UTC
    I was certain that the file was ASCII. Correction, I was absolutely certain that it was ASCII.

    It wasn't.

    There are two ways of generating scripts in SQL Server 2000's Enterprise Manager. The script generator can save them to a file, or preview them and you can copy/paste into whatever you want. This is the route that I normally go. I did not notice that the final option screen let you specify OEM, ANSI or Unicode, and it defaults to Unicode.

    *bang head against wall*
    *rinse, repeat*

    I couldn't find a hex mode in TextPad, turns out that you specify a binary file type in the Open dialog, and then it quite obviously was Unicode.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://693834]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2019-08-23 13:59 GMT
Find Nodes?
    Voting Booth?

    No recent polls found