Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ImportedProjects
SVG
Commits
e3f452a3
Commit
e3f452a3
authored
8 years ago
by
Tebjan Halm
Committed by
GitHub
8 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #269 from avogelba/master
add XML header and support for disabling the BOM in SvgDocument.cs
parents
07159633
a5333645
master
netstandard2
nuget2.4.2
nuget2.4.1
nuget2.4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Source/SvgDocument.cs
+7
-7
Source/SvgDocument.cs
with
7 additions
and
7 deletions
+7
-7
Source/SvgDocument.cs
+
7
-
7
View file @
e3f452a3
...
@@ -575,12 +575,12 @@ namespace Svg
...
@@ -575,12 +575,12 @@ namespace Svg
}
}
}
}
public
void
Write
(
Stream
stream
)
public
void
Write
(
Stream
stream
,
bool
useBom
=
true
)
{
{
var
xmlWriter
=
new
XmlTextWriter
(
stream
,
Encoding
.
UTF8
);
var
xmlWriter
=
new
XmlTextWriter
(
stream
,
useBom
?
Encoding
.
UTF8
:
new
System
.
Text
.
UTF8Encoding
(
false
)
);
xmlWriter
.
Formatting
=
Formatting
.
Indented
;
xmlWriter
.
Formatting
=
Formatting
.
Indented
;
xmlWriter
.
WriteStartDocument
();
xmlWriter
.
WriteDocType
(
"svg"
,
"-//W3C//DTD SVG 1.1//EN"
,
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"
,
null
);
xmlWriter
.
WriteDocType
(
"svg"
,
"-//W3C//DTD SVG 1.1//EN"
,
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"
,
null
);
if
(!
String
.
IsNullOrEmpty
(
this
.
ExternalCSSHref
))
if
(!
String
.
IsNullOrEmpty
(
this
.
ExternalCSSHref
))
...
@@ -591,11 +591,11 @@ namespace Svg
...
@@ -591,11 +591,11 @@ namespace Svg
xmlWriter
.
Flush
();
xmlWriter
.
Flush
();
}
}
public
void
Write
(
string
path
)
public
void
Write
(
string
path
,
bool
useBom
=
true
)
{
{
using
(
var
fs
=
new
FileStream
(
path
,
FileMode
.
Create
,
FileAccess
.
Write
))
using
(
var
fs
=
new
FileStream
(
path
,
FileMode
.
Create
,
FileAccess
.
Write
))
{
{
this
.
Write
(
fs
);
this
.
Write
(
fs
,
useBom
);
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help