Created
July 6, 2015 05:11
-
-
Save ColinScott/3e6668b4607403c9b8d0 to your computer and use it in GitHub Desktop.
Fix SQL mangling when encoded in stupid format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var filename = @"<file path>"; | |
var bytes = File.ReadAllBytes(filename); | |
var newBytes = new List<byte>(); | |
for (var i = 0; i < bytes.Length; i++) | |
{ | |
if (bytes[i] == 0x0D && bytes[i+1] == 0x0A) | |
{ | |
i++; | |
} | |
newBytes.Add(bytes[i]); | |
} | |
File.WriteAllBytes(filename, newBytes.ToArray()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment