mirror of
				https://github.com/Kopano-dev/kopano-ol-extension.git
				synced 2023-10-10 11:37:40 +00:00 
			
		
		
		
	[KOE-70] Added explicit BOM to HTML signature files, to prevent encoding errors
This commit is contained in:
		| @@ -82,14 +82,27 @@ namespace Acacia.Stubs.OutlookWrappers | |||||||
|  |  | ||||||
|         public void SetContent(string content, ISignatureFormat format) |         public void SetContent(string content, ISignatureFormat format) | ||||||
|         { |         { | ||||||
|             string path = GetPath(format, false); |             WriteContent(content, format, false); | ||||||
|             File.WriteAllText(path, content); |  | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         public void SetContentTemplate(string content, ISignatureFormat format) |         public void SetContentTemplate(string content, ISignatureFormat format) | ||||||
|         { |         { | ||||||
|             string path = GetPath(format, true); |             WriteContent(content, format, true); | ||||||
|             File.WriteAllText(path, content); |         } | ||||||
|  |  | ||||||
|  |         private void WriteContent(string content, ISignatureFormat format, bool isTemplate) | ||||||
|  |         { | ||||||
|  |             string path = GetPath(format, isTemplate); | ||||||
|  |  | ||||||
|  |             if (format == ISignatureFormat.HTML) | ||||||
|  |             { | ||||||
|  |                 // [KOE-70] If the html file does not have a BOM, it sometimes gives encoding errors. | ||||||
|  |                 File.WriteAllText(path, content, new UTF8Encoding(true)); | ||||||
|  |             } | ||||||
|  |             else | ||||||
|  |             { | ||||||
|  |                 File.WriteAllText(path, content); | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         public string GetContentTemplate(ISignatureFormat format) |         public string GetContentTemplate(ISignatureFormat format) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user