Home | History | Annotate | Download | only in idlelib

Lines Matching defs:encoding

29 # what encoding to use
36 # Encoding for file names
39 encoding = "ascii"
42 # a portable encoding name, we need to find the code page
44 encoding = locale.getdefaultlocale()[1]
45 codecs.lookup(encoding)
54 encoding = locale.nl_langinfo(locale.CODESET)
55 if encoding is None or encoding is '':
57 encoding = 'ascii'
58 codecs.lookup(encoding)
64 encoding = locale.getdefaultlocale()[1]
65 if encoding is None or encoding is '':
67 encoding = 'ascii'
68 codecs.lookup(encoding)
72 encoding = encoding.lower()
77 "Inform user that an encoding declaration is needed."
90 text="Non-ASCII found, yet no encoding declared. Add a line like")
123 """Return the encoding declaration according to PEP 263.
125 Raise LookupError if the encoding is declared but unknown.
135 # Check whether the encoding is known
140 # The standard encoding error does not indicate the encoding
141 raise LookupError, "Unknown encoding "+name
300 message="The encoding '%s' is not known to this Python "\
314 # Finally, try the locale's encoding. This is deprecated;
315 # the user should declare a non-ASCII encoding
317 chars = unicode(chars, encoding)
318 self.fileencoding = encoding
398 # This is either plain ASCII, or Tk was returning mixed-encoding
402 # If not, no need to figure out the encoding.
407 # If there is an encoding declared, try this first.
418 failed = "Invalid encoding '%s'" % enc
427 # Try the original file encoding next, if any
438 # Nothing was declared, and we had not determined an encoding
439 # on loading. Recommend an encoding line.
441 "encoding")
447 chars = chars.encode(encoding)
448 enc = encoding
463 # Insert encoding after #! line