Skip to content

Commit

Permalink
[fix w3c#1097] downgrade PKG-012 (filename contains non-ASCII) from W…
Browse files Browse the repository at this point in the history
…ARNING to USAGE
  • Loading branch information
slonopotamus committed Jan 23, 2020
1 parent 6af3b98 commit 60ae950
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ private void initialize()
severities.put(MessageId.PKG_009, Severity.ERROR);
severities.put(MessageId.PKG_010, Severity.WARNING);
severities.put(MessageId.PKG_011, Severity.ERROR);
severities.put(MessageId.PKG_012, Severity.WARNING);
severities.put(MessageId.PKG_012, Severity.USAGE);
severities.put(MessageId.PKG_013, Severity.ERROR);
severities.put(MessageId.PKG_014, Severity.WARNING);
severities.put(MessageId.PKG_015, Severity.FATAL);
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/adobe/epubcheck/ocf/OCFFilenameChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ public static String checkCompatiblyEscaped(final String str, Report report, EPU

private static String checkNonAsciiFilename(final String str, Report report)
{
// TODO change this from warning to a compatibility hint message level

String nonAscii = str.replaceAll("[\\p{ASCII}]", "");
if (nonAscii.length() > 0)
{
Expand Down
3 changes: 1 addition & 2 deletions src/test/java/com/adobe/epubcheck/api/Epub30CheckTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,7 @@ public void testDuplicateZipEntriesIssue265()
@Test
public void testDuplicateZipEntriesIssue265b()
{
Collections.addAll(expectedWarnings, MessageId.OPF_061, MessageId.OPF_003, MessageId.PKG_012,
MessageId.PKG_012);
Collections.addAll(expectedWarnings, MessageId.OPF_061, MessageId.OPF_003);
// non-unique entry names (after NFC normalization) should raise a warning
testValidateDocument("invalid/issue265b.epub");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ OPF-035 WARNING Media type 'text/html' is not appropriate for XHTML/OPS. Use 'ap
OPF-036 USAGE Video type '%1$s' might not be supported by reading systems Use 'video/mp4', 'video/h264' or 'video/webm' instead.
OPF-037 WARNING Found deprecated media-type '%1$s'.
OPF-038 WARNING Media type '%1$s' is not appropriate for an OEBPS 1.2 context; Use 'text/x-oeb1-document' instead.
OPF-039 WARNING Media-type '%1$s' is not appropriate in an OEBPS 1.2 context. Use 'text/x-oeb1-css' instead.
OPF-039 WARNING Media-type '%1$s' is not appropriate in an OEBP S 1.2 context. Use 'text/x-oeb1-css' instead.
OPF-040 ERROR Fallback item could not be found.
OPF-041 ERROR Fallback-style item could not be found.
OPF-042 ERROR '%1$s' is not a permissible spine media-type.
Expand Down Expand Up @@ -177,7 +177,7 @@ PKG-008 FATAL Unable to read file '%1$s'.
PKG-009 ERROR File name contains characters that are not allowed in OCF file names: '%1$s'.
PKG-010 WARNING Filename contains spaces, therefore URI escaping is necessary. Consider removing spaces from filename.
PKG-011 ERROR Filename is not allowed to end with '.'.
PKG-012 WARNING File name contains the following non-ascii characters: %1$s. Consider changing the filename.
PKG-012 USAGE File name contains the following non-ascii characters: %1$s. Consider changing the filename.
PKG-013 ERROR The EPUB file includes multiple OPS renditions.
PKG-014 WARNING The EPUB contains empty directory '%1$s'.
PKG-015 FATAL Unable to read EPUB contents: %1$s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"suggestion" : null
}, {
"ID" : "PKG-012",
"severity" : "WARNING",
"severity" : "USAGE",
"message" : "File name contains the following non-ascii characters: \u0424. Consider changing the filename.",
"additionalLocations" : 0,
"locations" : [ {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<message severity="error" subMessage="RSC-007">RSC-007, ERROR, [Referenced resource 'style.' could not be found in the EPUB.], OPS Content/Cyrillic_Ф.xhtml (6-62)</message>
<message severity="error" subMessage="RSC-007">RSC-007, ERROR, [Referenced resource '../XHTML Content/page 02.xhtml' could not be found in the EPUB.], OPS Content/Cyrillic_Ф.xhtml (13-53)</message>
<message severity="error" subMessage="PKG-009">PKG-009, ERROR, [File name contains characters that are not allowed in OCF file names: '"{","}"'.], OPS Content/page{03}.xhtml</message>
<message severity="error" subMessage="PKG-012">PKG-012, WARN, [File name contains the following non-ascii characters: Ф. Consider changing the filename.], OPS Content/Cyrillic_Ф.xhtml</message>
<message severity="error" subMessage="PKG-012">PKG-012, USAGE, [File name contains the following non-ascii characters: Ф. Consider changing the filename.], OPS Content/Cyrillic_Ф.xhtml</message>
<message severity="error" subMessage="PKG-010">PKG-010, WARN, [Filename contains spaces, therefore URI escaping is necessary. Consider removing spaces from filename.], OPS Content/Cyrillic_Ф.xhtml</message>
<message severity="error" subMessage="PKG-010">PKG-010, WARN, [Filename contains spaces, therefore URI escaping is necessary. Consider removing spaces from filename.], OPS Content/More XHTML Content/page01.xhtml</message>
<message severity="error" subMessage="PKG-010">PKG-010, WARN, [Filename contains spaces, therefore URI escaping is necessary. Consider removing spaces from filename.], OPS Content/content.opf</message>
Expand Down

0 comments on commit 60ae950

Please sign in to comment.