0

I have no idea how can I insert boolean sign into RTF document from java programm. I think about √ or ✓ and –. I tried insert these signs to clear document and save it as *.rtf and then open it in Notepad++ but there is a lot of codes (~160 lines) and I can not understand what is it. Do you have any idea?

Jacob
  • 1
  • 3
  • You may want [this specification](http://www.microsoft.com/en-us/download/details.aspx?id=10725). I pity you. – tilpner Oct 11 '14 at 19:29

2 Answers2

0

After a short search I found this:

Writing unicode to rtf file

So a final code version would be:

public void writeToFile() {

    String strJapanese = "日本語✓";

    try {
        FileOutputStream fos = new FileOutputStream("test.rtf");
        Writer out = new OutputStreamWriter(fos, "UTF8");
        out.write(strJapanese);
        out.close();
    } catch (IOException e) {
        e.printStackTrace();
    }
}
Community
  • 1
  • 1
Tammo
  • 1
  • 1
0

Please read about RTF

√ or ✓ and – are not available in every charset, so specify it. If yout output in UTF-8 (and i advise you to do so, check here on how to do this). You might need to encode the sign aswell, check Wikipedia

Community
  • 1
  • 1
paulgavrikov
  • 1,883
  • 3
  • 29
  • 51