diff options
author | Andreas Bille <abi@openoffice.org> | 2001-02-16 15:58:40 +0000 |
---|---|---|
committer | Andreas Bille <abi@openoffice.org> | 2001-02-16 15:58:40 +0000 |
commit | d7a7ca196e535b717f59670a726b6a2196b70c74 (patch) | |
tree | c62aebd4d208759adcc4feb2feff2a35d1825689 /xmlhelp | |
parent | 63124e8072f53bf39ed3ad9fe240cace48ae513a (diff) |
#83917#
Missing explicit UTF-8 encodings in constructors of Strings from
byte-arrays or vice-versa.
A new indexing of the help files is necessary.
Diffstat (limited to 'xmlhelp')
-rw-r--r-- | xmlhelp/source/com/sun/star/help/HelpIndexer.java | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/xmlhelp/source/com/sun/star/help/HelpIndexer.java b/xmlhelp/source/com/sun/star/help/HelpIndexer.java index ed1f5c3afc6f..e5503503f73a 100644 --- a/xmlhelp/source/com/sun/star/help/HelpIndexer.java +++ b/xmlhelp/source/com/sun/star/help/HelpIndexer.java @@ -216,8 +216,20 @@ public class HelpIndexer { _urlHandler.setMode( null ); byte[] embResolved = getSourceDocument( url ); - //System.out.println( new String( embResolved ) ); - InputSource in = new InputSource( new ByteArrayInputStream( embResolved ) ); +// InputSource in = new InputSource( new ByteArrayInputStream( embResolved ) ); + + ByteArrayInputStream inbyte = new ByteArrayInputStream(embResolved); + InputStreamReader inread; + try + { + inread = new InputStreamReader( inbyte,"UTF8" ); + } + catch( UnsupportedEncodingException e ) + { + inread = new InputStreamReader( inbyte ); + } + InputSource in = new InputSource( inread ); + in.setEncoding( "UTF8" ); Document docResolved = null; try @@ -228,6 +240,7 @@ public class HelpIndexer { { if( docResolved == null ) System.err.println( "Nullpointer" ); + System.err.println( e.getMessage() ); } @@ -253,7 +266,6 @@ public class HelpIndexer { int idx = url.indexOf( '?' ); if( idx != -1 ) url = url.substring( 0,idx ); - System.out.println( url ); builder.indexDocument( new URL( url ),"" ); } @@ -286,12 +298,12 @@ public class HelpIndexer { } catch (FileNotFoundException fnfe) { - System.err.println("HelpAccess: " + fnfe.toString()); + System.err.println("HelpAccess: " + fnfe.getMessage() ); System.exit(1); } catch( java.lang.Exception e ) { - System.out.println( "any other exception" ); + System.out.println( "any other exception" + e.getMessage() ); } } @@ -436,8 +448,6 @@ public class HelpIndexer { StringDbt key = new StringDbt( list[i] ); StringDbt value = new StringDbt( data.getString() ); table.put( null,key,value,0); - - // System.out.println( list[i] + " " + data.getString() ); } table.close( 0 ); } |