Skip to content

The Chinese query encoding issue in the function ConvertToGormConditions of the file query_condition.go in sgorm/query/ #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
SamQK opened this issue May 8, 2025 · 1 comment

Comments

@SamQK
Copy link

SamQK commented May 8, 2025

When I made a query request to the Go backend built with sponge for the value, I encountered a problem where Chinese characters would cause encoding errors and result in query failure. I roughly identified the issue to be in the code segment "str += column.Name + column.Exp + symbol", where symbol is the SQL value expression obtained through column.convert() (instead of the ? placeholder). It is recommended to use parameterized writing.

@zhufuyi
Copy link
Collaborator

zhufuyi commented May 9, 2025

Can you provide more details about the error? ?

  • The client requests query parameter json information
  • Log print sql information
  • Log print error message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants