def encode(cls, string, encoding=None): """Encode the string""" # FIXME: dialects are a bad idea, not possible for subclasses # to override key methods if encoding != "utf-8": return quote.javapropertiesencode(string or u"") return quote.java_utf8_properties_encode(string or u"")
def encode(cls, string, encoding=None): """Encode the string""" # FIXME: dialects are a bad idea, not possible for subclasses # to override key methods if encoding not in ("utf-8", "utf-16"): return quote.javapropertiesencode(string or "") return quote.java_utf8_properties_encode(string or "")
def encode(cls, string, encoding=None): return quote.java_utf8_properties_encode(string or "")
def encode(cls, string, encoding=None): """Encode the string""" string = quote.java_utf8_properties_encode(string or "") string = quote.mozillaescapemarginspaces(string or "") return string
def test_java_utf8_properties_encode(): assert quote.java_utf8_properties_encode("abc") == "abc" assert quote.java_utf8_properties_encode("abcḓ") == "abcḓ" assert quote.java_utf8_properties_encode("abc\n") == "abc\\n"
def test_java_utf8_properties_encode(self): assert quote.java_utf8_properties_encode(u"abc") == u"abc" assert quote.java_utf8_properties_encode(u"abcḓ") == u"abcḓ" assert quote.java_utf8_properties_encode(u"abc\n") == u"abc\\n"
def encode(cls, string, encoding=None): return quote.java_utf8_properties_encode(string or u"")
def encode(cls, string, encoding=None): """Encode the string""" string = quote.java_utf8_properties_encode(string or u"") string = quote.mozillaescapemarginspaces(string or u"") return string