Python | sys.getdefaultencoding() method
This sys module provides access to some variables used or maintained by the interpreter and to functions that interact strongly with the interpreter. It provides information about constants, functions and methods of python interpreter. It can be used for manipulating Python runtime environment.
sys.getdefaultencoding() method is used to get the current default string encoding used by the Unicode implementation.
Syntax: sys.getdefaultencoding()
Parameter: This method accepts no parameter.
Return Value: This method returns the current default string encoding used by the Unicode implementation.
Example #1 :
# Python program to explain sys.getdefaultencoding() method # Importing sys module import sys # Using sys.getdefaultencoding() method encoding = sys.getdefaultencoding() # Print the current string encoding used print(encoding) |
utf-8
Recommended Posts:
- class method vs static method in Python
- Python | set() method
- Python | os.dup() method
- Python | next() method
- Python | os.times() method
- Python | sympy.cot() method
- Python | os.fstat() method
- Python | os.unlink() method
- Python PIL | Image.new() method
- Python | os.fdatasync() method
- Python | sympy.crt() method
- Python | os.WIFEXITED() method
- Python | os.waitid() method
- Python | os.open() method
- Python | sympy.csc() method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



