src/Tools/jEdit/src/isabelle_encoding.scala
author wenzelm
Mon Dec 04 22:52:16 2017 +0100 (12 months ago)
changeset 67130 b023f64e0d16
parent 66457 9098c36abd1a
permissions -rw-r--r--
tuned signature;
     1 /*  Title:      Tools/jEdit/src/isabelle_encoding.scala
     2     Author:     Makarius
     3 
     4 Isabelle encoding -- based on UTF-8.
     5 */
     6 
     7 package isabelle.jedit
     8 
     9 
    10 import isabelle._
    11 
    12 import org.gjt.sp.jedit.buffer.JEditBuffer
    13 
    14 
    15 object Isabelle_Encoding
    16 {
    17   def is_active(buffer: JEditBuffer): Boolean =
    18     buffer.getStringProperty(JEditBuffer.ENCODING).asInstanceOf[String] == "UTF-8-Isabelle"
    19 
    20   def perhaps_decode(buffer: JEditBuffer, s: String): String =
    21     if (is_active(buffer)) Symbol.decode(s) else s
    22 }