What is used to create Unicode string in Python?

Answer Posted / chaitanya

Unicode is a system to represent characters from all the world's different languages.

Two methods can be used to create unicode string:

unicode() method is unicode(string[, encoding, errors]), its arguments should be 8-bit strings. The first argument is converted to Unicode using the specified encoding, if encoding argument left, the ASCII encoding is used for the conversion.

encode() method is encode([encoding], [errors='strict']), which returns an 8-bit string version of the Unicode string.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is that none of my threads are not running? How can I make it work?

466


Write a program to show the singleton pattern used in python.

461


How to count the occurrences of a list item?

446


Short description of the scoping rules?

445


Why anaconda is used for python?

468






What is the use of map in python?

462


Does python sleep use cpu?

489


What are tuples and relation?

426


How would you define a protected member in a python class ?

455


What is "typeerror: 'module' object is not callable"?

535


How do you create a dictionary which can preserve the order of pairs?

522


What is Pickling and unpickling?

491


How can you find length of a tuple in python?

451


What is the use of assertions in python?

475


Is python a scripting or programming?

426