Skip to content

Commit f368ee5

Browse files
slonopotamusrdeltour
authored andcommitted
fix: downgrade PKG-012 (non-ASCII filenames) to USAGE
Fixes #1097
1 parent 659ab76 commit f368ee5

File tree

6 files changed

+7
-10
lines changed

6 files changed

+7
-10
lines changed

src/main/java/com/adobe/epubcheck/messages/DefaultSeverities.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ private void initialize()
276276
severities.put(MessageId.PKG_009, Severity.ERROR);
277277
severities.put(MessageId.PKG_010, Severity.WARNING);
278278
severities.put(MessageId.PKG_011, Severity.ERROR);
279-
severities.put(MessageId.PKG_012, Severity.WARNING);
279+
severities.put(MessageId.PKG_012, Severity.USAGE);
280280
severities.put(MessageId.PKG_013, Severity.ERROR);
281281
severities.put(MessageId.PKG_014, Severity.WARNING);
282282
severities.put(MessageId.PKG_015, Severity.FATAL);

src/main/java/com/adobe/epubcheck/ocf/OCFFilenameChecker.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ public static String checkCompatiblyEscaped(final String str, Report report, EPU
8787

8888
private static String checkNonAsciiFilename(final String str, Report report)
8989
{
90-
// TODO change this from warning to a compatibility hint message level
91-
9290
String nonAscii = str.replaceAll("[\\p{ASCII}]", "");
9391
if (nonAscii.length() > 0)
9492
{

src/test/java/com/adobe/epubcheck/api/Epub30CheckTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,7 @@ public void testDuplicateZipEntriesIssue265()
225225
@Test
226226
public void testDuplicateZipEntriesIssue265b()
227227
{
228-
Collections.addAll(expectedWarnings, MessageId.OPF_061, MessageId.OPF_003, MessageId.PKG_012,
229-
MessageId.PKG_012);
228+
Collections.addAll(expectedWarnings, MessageId.OPF_061, MessageId.OPF_003);
230229
// non-unique entry names (after NFC normalization) should raise a warning
231230
testValidateDocument("invalid/issue265b.epub");
232231
}

src/test/resources/com/adobe/epubcheck/test/command_line/listSeverities_expected_results.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ PKG-008 FATAL Unable to read file '%1$s'.
177177
PKG-009 ERROR File name contains characters that are not allowed in OCF file names: '%1$s'.
178178
PKG-010 WARNING Filename contains spaces, therefore URI escaping is necessary. Consider removing spaces from filename.
179179
PKG-011 ERROR Filename is not allowed to end with '.'.
180-
PKG-012 WARNING File name contains the following non-ascii characters: %1$s. Consider changing the filename.
180+
PKG-012 USAGE File name contains the following non-ascii characters: %1$s. Consider changing the filename.
181181
PKG-013 ERROR The EPUB file includes multiple OPS renditions.
182182
PKG-014 WARNING The EPUB contains empty directory '%1$s'.
183183
PKG-015 FATAL Unable to read EPUB contents: %1$s

src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub3_expected_results.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"suggestion" : null
8080
}, {
8181
"ID" : "PKG-012",
82-
"severity" : "WARNING",
82+
"severity" : "USAGE",
8383
"message" : "File name contains the following non-ascii characters: \u0424. Consider changing the filename.",
8484
"additionalLocations" : 0,
8585
"locations" : [ {
@@ -135,8 +135,8 @@
135135
"elapsedTime" : 78,
136136
"nFatal" : 0,
137137
"nError" : 4,
138-
"nWarning" : 2,
139-
"nUsage" : 2
138+
"nWarning" : 1,
139+
"nUsage" : 3
140140
},
141141
"publication" : {
142142
"publisher" : null,

src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub3_expected_results.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<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>
1818
<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>
1919
<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>
20-
<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>
20+
<message severity="info" subMessage="PKG-012">PKG-012, HINT, [File name contains the following non-ascii characters: Ф. Consider changing the filename.], OPS Content/Cyrillic_Ф.xhtml</message>
2121
<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>
2222
<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>
2323
<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>

0 commit comments

Comments
 (0)