Buggy code:
int bottomMargin ; Color marginColor ; int columnX ; int caretOffset ; int caretAlignment ; Point selection = new Point ( 0 , 0 ) ; Point clipboardSelection ; int selectionAnchor ; Point doubleClickSelection ; boolean editable = true ; boolean wordWrap = false ; boolean doubleClickEnabled = true ; boolean overwrite = false ; int textLimit = - 1 ; Hashtable keyActionMap = new Hashtable ( ) ; Color background = null ; Color foreground = null ; Clipboard clipboard ; int clickCount ; int autoScrollDirection = SWT . NULL ; int autoScrollDistance = 0 ; int lastTextChangeStart ; int lastTextChangeNewLineCount ; int lastTextChangeNewCharCount ; int lastTextChangeReplaceLineCount ; int lastTextChangeReplaceCharCount ; int lastCharCount = 0 ; int lastLineBottom ; boolean isMirrored ; boolean bidiColoring = false ; Image leftCaretBitmap = null ; Image rightCaretBitmap = null ; int caretDirection = SWT . NULL ; int caretWidth = 0 ; Caret defaultCaret = null ; boolean updateCaretDirection = true ; boolean fixedLineHeight ; boolean dragDetect = true ; IME ime ; Cursor cursor ; int alignment ; boolean justify ; int indent ; int wrapIndent ; int lineSpacing ; int alignmentMargin ; int newOrientation = SWT . NONE ; boolean blockSelection ; int blockXAnchor = - 1 ; int blockYAnchor = - 1 ; int blockXLocation = - 1 ; int blockYLocation = - 1 ; static final boolean IS_MAC ; static final boolean IS_GTK ; static final boolean IS_MOTIF ; static class Printing implements Runnable { static final int LEFT = 0 ; static final int CENTER = 1 ; static final int RIGHT = 2 ; Printer printer ; StyledTextRenderer printerRenderer ; StyledTextPrintOptions printOptions ; Rectangle clientArea ; FontData fontData ; Font printerFont ; Hashtable resources ; int tabLength ; GC gc ; int pageWidth ; int startPage ; int endPage ; int startLine ; int endLine ; boolean singleLine ; Point selection = null ; boolean mirrored ; int lineSpacing ; int printMargin ; Printing ( StyledText styledText , Printer printer , StyledTextPrintOptions printOptions ) { } void cacheLineData ( StyledText styledText ) { } StyledTextContent copyContent ( StyledTextContent original ) { } void dispose ( ) { } void init ( ) { } void print ( ) { } void printDecoration ( int page , boolean header , TextLayout layout ) { } void printDecorationSegment ( String segment , int alignment , int page , boolean header , TextLayout layout ) { } void printLine ( int x , int y , GC gc , Color foreground , Color background , TextLayout layout , TextLayout printLayout , int index ) { } public void run ( ) { } } class RTFWriter extends StyledText . TextWriter { static final int DEFAULT_FOREGROUND = 0 ; static final int DEFAULT_BACKGROUND = 1 ; Vector colorTable ; Vector fontTable ; boolean WriteUnicode ; public RTFWriter ( int start , int length ) { } public void close ( ) { } int getColorIndex ( Color color , int defaultIndex ) { } int getFontIndex ( Font font ) { } void setUnicode ( ) { } void write ( String string , int start , int end ) { for ( int index = start ; index < end ; index ++ ) { char ch = string . charAt ( index ) ; <START_BUG> if ( ( ch > 255 ) && ( WriteUnicode ) ) { <END_BUG> if ( index > start ) { write ( string . substring ( start , index ) ) ; } write ( "\\u" ) ; write ( Integer . toString ( ( ( short ) ( ch ) ) ) ) ; write ( '?' ) ; start = index + 1 ; } else if ( ( ( ch == '}' ) || ( ch == '{' ) ) || ( ch == '\\' ) ) { if ( index > start ) { write ( string . substring ( start , index ) ) ; } write ( '\\' ) ; write ( ch ) ; start = index + 1 ; } } if ( start < end ) { write ( string . substring ( start , end ) ) ; } } void writeHeader ( ) { } public void writeLine ( String line , int lineOffset ) { } public void writeLineDelimiter ( String lineDelimiter ) { } void writeStyledLine ( String line , int lineOffset , int [ ] ranges , StyleRange [ ] styles , Color lineBackground , int indent , int alignment , boolean justify ) { } } class TextWriter { private StringBuffer buffer ; private int startOffset ; private int endOffset ; private boolean isClosed = false ; public TextWriter ( int start , int length ) { } public void close ( ) { } public int getCharCount ( ) { } public int getStart ( ) { } public boolean isClosed ( ) { } public String toString ( ) { } void write ( String string ) { } void write ( String string , int offset ) { } void write ( int i ) { } void write ( char i ) { } public void writeLine ( String line , int lineOffset ) { } public void writeLineDelimiter ( String lineDelimiter ) { } } public StyledText ( Composite parent , int style ) { } public void addExtendedModifyListener ( ExtendedModifyListener extendedModifyListener ) { } public void addBidiSegmentListener ( BidiSegmentListener listener ) { } public void addCaretListener ( CaretListener listener ) { } public void addLineBackgroundListener ( LineBackgroundListener listener ) { } public void addLineStyleListener ( LineStyleListener listener ) { } public void addModifyListener ( ModifyListener modifyListener ) { } public void addPaintObjectListener ( PaintObjectListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } public void addVerifyKeyListener ( VerifyKeyListener listener ) { } public void addVerifyListener ( VerifyListener verifyListener ) { }

Fix:
if ( ( ch > 127 ) && ( WriteUnicode ) ) {