-
Notifications
You must be signed in to change notification settings - Fork 180
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
quote_ident loses encoding #163
Comments
Original comment by Lars Kanis (Bitbucket: larskanis, GitHub: larskanis). I can add this it. Connection#quote_ident is the home-brewed version of #escape_identifier which was introduced in postgresql-9.0. So this is duplicated code. Both are almost equally fast in a simple test I just did (quote_ident has a little less overhead for each call but escape_identifier is faster with more than approximately 7 characters) and they do exactly the same. Both don't set the encoding so far. Any thoughts about the future of them? Should we deprecate quote_ident or alias it to escape_identifier or leave it like it is and add a comment only? |
Original report by Matt Daw (Bitbucket: mattdaw, GitHub: mattdaw).
Calling quote_ident on a UTF8 encoded string "shot_sg_assigned_to___dělá_kdo___connections" produces ASCII encoded string ""shot_sg_assigned_to___d\xC4\x9Bl\xC3\xA1_kdo___connections"".
I'm modifying the result using force_encoding, which is a reasonable workaround... but it would be nice to have it fixed in the gem.
The text was updated successfully, but these errors were encountered: