/* * escapeProperties.bsh * * A Macro to escape text in the same way that a java properties file needs it. * Useful when making properties file for languages whose glyphs are beyond ISO-8859-1 * * Rainiero Rainoldi */ void escapeProperties() { sel = textArea.getSelectedText(); if (sel == null) sel = ""; Properties ptmp = new Properties(); ptmp.setProperty("1",sel); PipedOutputStream o = new PipedOutputStream(); PipedInputStream ip = new PipedInputStream(); o.connect(ip); BufferedReader bf = new BufferedReader(new InputStreamReader(ip)); ptmp.store(o,"RAI CONVERTER"); o.flush(); o.close(); bf.readLine(); bf.readLine(); esc = bf.readLine(); if (esc == null) esc = "NO"; bf.close(); textArea.setSelectedText(esc.substring(2)); } if (buffer.isReadOnly()) Macros.error(view, "Buffer is read-only."); else escapeProperties(); /* Macro index data (in DocBook format) Escape_Properties.bsh Transforms the selected text into a properties file escaped text. */ // end Escape_Properties.bsh