felipecrv commented on code in PR #4141:
URL: https://github.com/apache/arrow-adbc/pull/4141#discussion_r3017553424
##########
rust/core/src/error.rs:
##########
@@ -102,10 +102,26 @@ impl Error {
impl Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ let safe_ascii = |c: c_char| -> char {
+ if c == 0 {
+ '0'
+ } else if c >= 32 && c <= 126 {
+ char::from(c as u8)
+ } else {
+ '\u{FFFD}'
Review Comment:
I'm not hiding. I'm showing � to say "this is not valid UTF-8". SQLSTATE is
ASCII/UTF-8. A C implementation of this wouldn't even bother validating the
value. Would just be printing it from a `char *`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]