mbeckerle commented on code in PR #1149:
URL: https://github.com/apache/daffodil/pull/1149#discussion_r1458133609


##########
daffodil-core/src/main/scala/org/apache/daffodil/core/grammar/ElementBaseGrammarMixin.scala:
##########
@@ -700,6 +701,30 @@ trait ElementBaseGrammarMixin
       ConvertZonedCombinator(this, stringValue, textZonedConverter)
     }
 
+  /**
+   * True if the encoding is known to be an EBCDIC one, as in the encoding is 
not  a runtime expression
+   * and it's some ebcdic flavor. If it's any ascii flavor or a runtime 
expression this is false.
+   */
+  lazy val isKnownEBCDICEncoding: Boolean = {
+    charsetEv.optConstant
+      .map { bcs: BitsCharset =>
+        val nom = bcs.name.toUpperCase()
+        val res = (nom == "IBM037") ||
+          nom.startsWith("EBCDIC")

Review Comment:
   This may not be sufficient to recognize EBCDIC. There are numrous IBM code 
pages that are EBCDIC besides IBM037. There are ones for the international 
variants of EBCDIC. All of them do the exact same thing for zoned numbers. 
   
   We need something that will work regardless of the aliases vs. the 
"official" name. If the name, or any alias contains "ebcdic" (case insensitive) 
then it is an ebcdic variant. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to