-
Notifications
You must be signed in to change notification settings - Fork 404
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
Failing on writing Unicode Strings #37
Comments
Keys have to be ASCII. Could you share a key value pair which is not working? |
Nevermind them. I made all the strings ascii and kept the values Unicode and it seems to work well. |
how did you do that? |
Hive only accepts ASCII characters as entry keys. But this limitation does not applies to values. box.put('non-ascii-key', '...'); // will not work
box.put('ascii-key', 'non-ascii-value'); // will work |
Use this import 'dart:convert'; Convert your key to ascii code Var myKey= key.codeUnitAt(0).toString(); To retrieve your values Do the same thing, //results your values |
If it works for you, lemme know if it doesn't also lemme know with your error logs to help better |
Anyways posting error logs will help to better understand the issue. |
I get the following exception
HiveError: String contains non-ASCII characters.
whenever I write a Unicode string (currently, I am just trying to store some Arabic text as a String in the database).Any thoughts on how to fix this? I'm happy to implement the fix if you provide some pointers.
The text was updated successfully, but these errors were encountered: