I want to enable the user to send Chinese information, and then use the user's sent string as the condition to query records in the database (using mongodb); but the results are always not found. Use the mb_detect_encoding function to determine whether the sent data is returned by the encoding that is UTF-8, and then from the data... I want to enable the user to send Chinese information, and then query records in the database using the user's sent string as the condition (Use
Mongodb
), But the query results are always unavailable.
UseMb_detect_encoding
The function determines that the sent data is returned encoding is UTF-8, and then gets a piece of data from the databaseMb_detect_encoding
Function judge its encoding is UTF-8, solve, someone has encountered such a problem?
Note: writing text search directly in the code can return results normally.
Reply content:
I want to enable the user to send Chinese information, and then query records in the database using the user's sent string as the condition (UseMongodb
), But the query results are always unavailable.
UseMb_detect_encoding
The function determines that the sent data is returned encoding is UTF-8, and then gets a piece of data from the databaseMb_detect_encoding
Function judge its encoding is UTF-8, solve, someone has encountered such a problem?
Note: writing text search directly in the code can return results normally.