diff --git a/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java b/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java index e3bc643df..41533b008 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java @@ -61,6 +61,10 @@ public abstract class AbstractWordConverter private static final byte SPECCHAR_AUTONUMBERED_FOOTNOTE_REFERENCE = 2; + private static final char UNICODECHAR_NONBREAKING_HYPHEN = '\u2011'; + + private static final char UNICODECHAR_ZERO_WIDTH_SPACE = '\u200b'; + private final Set bookmarkStack = new LinkedHashSet(); private FontReplacer fontReplacer = new DefaultFontReplacer(); @@ -225,6 +229,16 @@ public abstract class AbstractWordConverter } processLineBreak( block, characterRun ); } + else if ( charChar == 30 ) + { + // Non-breaking hyphens are stored as ASCII 30 + stringBuilder.append( UNICODECHAR_NONBREAKING_HYPHEN ); + } + else if ( charChar == 31 ) + { + // Non-required hyphens to zero-width space + stringBuilder.append( UNICODECHAR_ZERO_WIDTH_SPACE ); + } else { stringBuilder.append( charChar );