oatpp/oatpp-postgresql

insert DTO type ENUM as string occurred encode problem

ColdeZhang opened this issue · 1 comments

I have a ENUM type as string, when I tried to insert it int to DB. Pg report an error "ERROR: invalid byte sequence for encoding "UTF8": 0x00"

It seems like oat++'s ENUM::String have an "\0" at the end of String, but PG's encoding doesn't recognized this char.

One noob solution of this problem is replace "\0" to "" at every String, but I am wondering if there is some more proper solution?