OT: Parsing Russian text from RTF

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

OT: Parsing Russian text from RTF

Not directly Lucene related, but I'm out of ideas and I'm not a Russian speaker...

I'm extracting text from RTF to pump into Lucene.  I'm using the original
RTFEditorKit() code shown in LIA, p252 (actually, it's Nutch's RTFParser)

I have an RTF document, which starts with

Times New Roman;}Times New Roman CYR;}{\f1\fswiss\fprq2\fcharset0 Arial;}}
{\colortbl ;\red0\green0\blue128;\red0\green0\blue0;}

which should be 'Большинство', but when the RTFReader translationTable always
maps the RTF bytes to char using latin1 and it never sets the correct
translationTable.  The "fcharset204" is Russian, apparently CP1251, but there's
a lovely line in the RTFReader class

/* TODO: per-font font encodings ( \fcharset control word ) ? */

Does anyone know if the RTF above is correct - the only place the translation
table is set during the parse is when the 'ansi' keyword is set.

Other than that, anyone have any ideas about getting the text out of the RTF


To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]