I am trying to insert one indian language string into mysql database using Repo.insert, but in database that value of that column showing like ???????????????
while creating database in mysql i am using ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; for unicode support, and inside elixir model i am using column type as string( field :displayname, :string )
I am not sure Ecto supports other than english language while insert into DB, need support from anybody how to do that.
String : ಆಗ್ತಾಇಲ್ಲ
After insert into mysql db using Repo.insert, in DB it is showing like ???????
String : ಆಗ್ತಾಇಲ್ಲ
After insert into mysql db using Repo.insert, in DB it should show ಆಗ್ತಾಇಲ್ಲ
This seems like an issue with mysql or the elixir driver mariaex. Ecto just passes the utf8 strings along to the driver.
@ok-madan yes, please file an issue on https://github.com/xerions/mariaex. Please include the mariaex version (it can be found in mix deps) and some sample commands in your report.
@ericmj , @josevalim Thanks for quick response and clarified my issue, i will create issue at mariaex repo.
I had the same issue and it was resolved after I set the value of the locale environment variable LC_ALL. Please check https://samueltthomas.com/setting-locale-for-fixing-unicode-issue-for-elixir for more info
For anyone else struggling with this, just add
binary_as: :field_type_blob
to your connection config and it solves this issue.
Most helpful comment
For anyone else struggling with this, just add
to your connection config and it solves this issue.