예제 #1
0
 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"")
예제 #2
0
 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 "")
예제 #3
0
 def encode(cls, string, encoding=None):
     return quote.java_utf8_properties_encode(string or "")
예제 #4
0
 def encode(cls, string, encoding=None):
     """Encode the string"""
     string = quote.java_utf8_properties_encode(string or "")
     string = quote.mozillaescapemarginspaces(string or "")
     return string
예제 #5
0
 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"
예제 #6
0
 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"
예제 #7
0
 def encode(cls, string, encoding=None):
     return quote.java_utf8_properties_encode(string or u"")
예제 #8
0
 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
예제 #9
0
 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"