Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use encodingErrorPolicy replace, even when set to error #1129

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,19 @@ trait TermEncodingMixin extends KnownEncodingMixin { self: Term =>
)
optionEncodingErrorPolicy.getOrElse(EncodingErrorPolicy.Replace)
}
if (policy == EncodingErrorPolicy.Error) {
// DFDL-935 to enable
SDW(
WarnID.EncodingErrorPolicyError,
"dfdl:encodingErrorPolicy=\"error\" is not yet implemented. The 'replace' value will be used.",
)
EncodingErrorPolicy.Replace
}
policy

// DFDL-935 to enable
schemaDefinitionWarningWhen(
WarnID.EncodingErrorPolicyError,
policy == EncodingErrorPolicy.Error,
"dfdl:encodingErrorPolicy=\"error\" is not yet implemented. The 'replace' value will be used.",
)

// The encodingErrorPolicy property is essentially ignored. We always use "replace", but
// warn if it is "error". This allows for compatibility with schemas written for IBM DFDL
// (which only supports "error") and has the same behavior as IBM DFDL as long as data does
// not contain encoding errors
EncodingErrorPolicy.Replace
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@

<tdml:document>
<tdml:documentPart type="text">1234</tdml:documentPart>
<tdml:documentPart type="byte">80</tdml:documentPart> <!-- invalid in US-ASCII -->
</tdml:document>

<tdml:warnings>
Expand All @@ -693,6 +694,7 @@
<ex:char>2</ex:char>
<ex:char>3</ex:char>
<ex:char>4</ex:char>
<ex:char>&#xFFFD;</ex:char> <!-- unicode replacement character -->
</ex:root>
</tdml:dfdlInfoset>
</tdml:infoset>
Expand Down