mirror of
https://github.com/jstemmer/go-junit-report.git
synced 2025-07-01 19:52:47 -05:00
junit: Specify unicode replacement character as \uFFFD
This is just to make the exact character we want to return explicit, otherwise it could be confused by any unsupported character in your text editor.
This commit is contained in:
@ -244,14 +244,14 @@ func escapeIllegalChars(str string) string {
|
||||
if isInCharacterRange(r) {
|
||||
return r
|
||||
}
|
||||
return '<EFBFBD>'
|
||||
return '\uFFFD'
|
||||
}, str)
|
||||
}
|
||||
|
||||
// Decide whether the given rune is in the XML Character Range, per
|
||||
// the Char production of https://www.xml.com/axml/testaxml.htm,
|
||||
// Section 2.2 Characters.
|
||||
// Form: encoding/xml/xml.go
|
||||
// From: encoding/xml/xml.go
|
||||
func isInCharacterRange(r rune) (inrange bool) {
|
||||
return r == 0x09 ||
|
||||
r == 0x0A ||
|
||||
|
Reference in New Issue
Block a user