Skip to content

Commit

Permalink
TEXT now force utf-8
Browse files Browse the repository at this point in the history
  • Loading branch information
Codetector1374 committed Jul 30, 2024
1 parent 871f343 commit 2cf04d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/innodb/table/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl Field {
FieldType::Char(len, _) => (
FieldValue::String(
String::from_utf8(buf[0..len as usize].into())
.unwrap()
.expect("Failed parsing UTF-8")
.trim_end()
.to_string(),
),
Expand All @@ -110,7 +110,8 @@ impl Field {
max_len,
self
);
let str = String::from_utf8_lossy(&buf[..length as usize])
let str = String::from_utf8(buf[..length as usize].into())
.expect("Failed parsing UTF-8")
.trim_end()
.to_string();
(FieldValue::String(str), length as usize)
Expand Down

0 comments on commit 2cf04d9

Please sign in to comment.