U4-5981 Umbraco 7.2 Text encoding when saving partial view template

#U4-5981 In Progress Assignee Shandem
This commit is contained in:
Sebastiaan Janssen
2014-12-18 13:56:50 +01:00
parent b8e98ae017
commit 72004768cf

View File

@@ -100,8 +100,19 @@ namespace Umbraco.Core.IO
if (stream.CanSeek)
stream.Seek(0, 0);
using (var destination = (Stream)File.Create(GetFullPath(fsRelativePath)))
stream.CopyTo(destination);
using (var memoryStream = new MemoryStream())
{
//Add the BOM
var bom = new byte[] { 0xEF, 0xBB, 0xBF };
memoryStream.Write(bom, 0, bom.Length);
stream.CopyTo(memoryStream);
if (memoryStream.CanSeek)
memoryStream.Seek(0, 0);
using (var destination = (Stream)File.Create(GetFullPath(fsRelativePath)))
memoryStream.CopyTo(destination);
}
}
public IEnumerable<string> GetFiles(string path)