Bug 58755 - POI can't encode hyperlink relation is not valid java.util.URI
Summary: POI can't encode hyperlink relation is not valid java.util.URI
Status: NEEDINFO
Alias: None
Product: POI
Classification: Unclassified
Component: OPC (show other bugs)
Version: 3.13-FINAL
Hardware: PC All
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-20 00:17 UTC by Andrey
Modified: 2015-12-21 16:38 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey 2015-12-20 00:17:09 UTC
poi can't encode following hyperlink #'Прайс-лист'!A1

issue is in org.apache.poi.openxml4j.opc.PackagingURIHelper#isUnsafe

fix:

instead of ch > 0x80 should be ch >= 0x80

e.g.

private static boolean isUnsafe(int ch) {
    return ch >= 0x80 || Character.isWhitespace(ch) || ch == '\u00A0';
}
Comment 1 Nick Burch 2015-12-21 16:38:11 UTC
Any chance you could write a short junit unit test showing the problem? We can then use that to confirm the fix, and also to ensure it stays fixed into the future