Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set mongodb charset to utf8?

I'm new to mongodb. I need to store some data in utf8 encoding in my DB. When I export them or see them into console, they don't display correctly. Can I set my database to utf8 character set to solve this problems? If yes, how can I do this?

like image 878
zorro6064 Avatar asked Jan 16 '13 10:01

zorro6064


People also ask

Does MongoDB support UTF-8?

MongoDB uses UTF-8 character encoding which is part of the Unicode Standard.

How do I change my UTF-8 character set?

Click Tools, then select Web options. Go to the Encoding tab. In the dropdown for Save this document as: choose Unicode (UTF-8). Click Ok.

Is UTF-8 a character set?

UTF-8 is a character encoding system. It lets you represent characters as ASCII text, while still allowing for international characters, such as Chinese characters.

Can UTF-8 support all characters?

UTF-8 supports any unicode character, which pragmatically means any natural language (Coptic, Sinhala, Phonecian, Cherokee etc), as well as many non-spoken languages (Music notation, mathematical symbols, APL). The stated objective of the Unicode consortium is to encompass all communications.


1 Answers

BSON can only be encoded in UTF-8. If your problem is with export and console, you probably are not converting your data to UTF-8 before uploading it to mongodb.

like image 165
joscas Avatar answered Oct 07 '22 14:10

joscas