Examples of fromUnicode()


Examples of com.trolltech.qt.core.QTextCodec.fromUnicode()

      tidy.getStderr().close()// the listener will capture messages
      tidy.setXmlTags(true);
     
      QTextCodec codec;
      codec = QTextCodec.codecForName("UTF-8");
          QByteArray unicode =  codec.fromUnicode(currentNote.getContent());
         
          logger.log(logger.MEDIUM, "Starting JTidy check");
          logger.log(logger.MEDIUM, "Start of JTidy Input");
          logger.log(logger.MEDIUM, currentNote.getContent());
          logger.log(logger.MEDIUM, "End Of JTidy Input");
View Full Code Here

Examples of com.trolltech.qt.core.QTextCodec.fromUnicode()

    tidy.setXmlTags(true);
    tidy.setXHTML(true);
   
    QTextCodec codec;
    codec = QTextCodec.codecForName("UTF-8");
        QByteArray unicode =  codec.fromUnicode(newContent);
       
//    byte html[] = newContent.getBytes();
//    ByteArrayInputStream is = new ByteArrayInputStream(html);
        logger.log(logger.HIGH, "Starting JTidy check");
        logger.log(logger.EXTREME, "Start of JTidy Input");
View Full Code Here

Examples of com.trolltech.qt.core.QTextCodec.fromUnicode()

      endPos = text.indexOf(">", imagePos);
      String tag = text.substring(imagePos-1,endPos);
      if (tag.indexOf("id=\""+id+"\"") > -1) {
          text = text.substring(0,imagePos) +plainText+text.substring(endPos+1)
          QTextCodec codec = QTextCodec.codecForName("UTF-8");
              QByteArray unicode =  codec.fromUnicode(text);
          setContent(unicode);
          if (permanent)
            contentChanged();
      }
      imagePos = text.indexOf("<img", imagePos+1);
View Full Code Here

Examples of com.trolltech.qt.core.QTextCodec.fromUnicode()

  // Source edited
  @SuppressWarnings("unused")
  private void sourceEdited() {
    QTextCodec codec = QTextCodec.codecForLocale();
    codec = QTextCodec.codecForName("UTF-8");
        String content =  codec.fromUnicode(sourceEdit.toHtml()).toString();
    content = StringEscapeUtils.unescapeHtml4(removeTags(content));
    QByteArray data = new QByteArray(sourceEditHeader+content+"</body></html>");
    getBrowser().setContent(data);
    checkNoteTitle();
    if (currentNote != null && sourceEdit != null)
View Full Code Here

Examples of com.trolltech.qt.core.QTextCodec.fromUnicode()

    logger.log(logger.EXTREME, "Entering NeverNote.setNoteDirty()");
   
    // Find if the note is being edited externally.  If it is, update it.
    if (externalWindows.containsKey(currentNoteGuid)) {
      QTextCodec codec = QTextCodec.codecForName("UTF-8");
          QByteArray unicode =  codec.fromUnicode(browserWindow.getContent());
      ExternalBrowse window = externalWindows.get(currentNoteGuid);
        window.getBrowserWindow().setContent(unicode);
    }
   
    // If the note is dirty, then it is unsynchronized by default.
View Full Code Here

Examples of com.trolltech.qt.core.QTextCodec.fromUnicode()

    logger.log(logger.EXTREME, "Leaving NeverNote.setNoteDirty()");
    }
    @SuppressWarnings("unused")
  private void saveNoteExternalBrowser(String guid, String content, Boolean save, BrowserWindow browser) {
    QTextCodec codec = QTextCodec.codecForName("UTF-8");
        QByteArray unicode =  codec.fromUnicode(content);
      noteCache.remove(guid);
    noteCache.put(guid, unicode.toString());
      if (guid.equals(currentNoteGuid)) {
        noteDirty = true;
        browserWindow.setContent(unicode);
View Full Code Here

Examples of com.trolltech.qt.core.QTextCodec.fromUnicode()

       
    logger.log(logger.EXTREME, "Saving to cache");
    QTextCodec codec = QTextCodec.codecForLocale();
//          QTextDecoder decoder = codec.makeDecoder();
    codec = QTextCodec.codecForName("UTF-8");
        QByteArray unicode =  codec.fromUnicode(window.getContent());
       noteCache.put(guid, unicode.toString());
     
       logger.log(logger.EXTREME, "updating list manager");
       listManager.updateNoteContent(guid, window.getContent());
    logger.log(logger.EXTREME, "Updating title");
View Full Code Here

Examples of com.trolltech.qt.core.QTextCodec.fromUnicode()

    }
   
    if (loadContent) {
      QTextCodec codec = QTextCodec.codecForLocale();
      codec = QTextCodec.codecForName("UTF-8");
          String unicode =  codec.fromUnicode(query.valueString(17)).toString();

          // This is a hack.  Basically I need to convert HTML Entities to "normal" text, but if I
          // convert the &lt; character to < it will mess up the XML parsing.  So, to get around this
          // I am "bit stuffing" the &lt; to &&lt; so StringEscapeUtils doesn't unescape it.  After
          // I'm done I convert it back.
View Full Code Here

Examples of com.trolltech.qt.core.QTextCodec.fromUnicode()

                String entity = buffer.substring(i,j).toString();
                int len = entity.length()-1;
                String tempEntity = entity.substring(2, len);
                try {
                  Integer.parseInt(tempEntity);
                  entity = codec.fromUnicode(StringEscapeUtils.unescapeHtml4(entity)).toString();
                  buffer.delete(i, j);
                  buffer.insert(i, entity);
                } catch (Exception e){ }
               
              }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.