Utf-8 encoding/decoding

Hello,

I have tried to store text contents in DB table in Hebrew but when I try to access them
there is an error due to “unicode characters”, is there a way to decode and encode Hebrew in Anvil ?

Thanks,

Guy Rai

Is the data (1) in Anvil’s data tables, and (2) in a string column?

Assuming yes, does this not work (for example) :

mystring = app_table.mytable.get(col='xx').decode()

Maybe could you create a very simple app that reproduces the issue and post the clone link here (or pm me)?

Ok, here’s an app that reads what I believe to be Hebrew text from a data table (I cut & pasted it from a webpage that said it was in hebrew).

It didn’t need any decoding.

https://anvil.works/build#clone:C3AWEAUPEOYMEI7P=OEAFAXU45GYA4YEOJBV47RLG

Can you maybe share what you’re doing and I might be able to help more.

Thanks for replying me so quickly :slight_smile:

I have tried again and seems this has nothing to do with the DB, I have stored and pulled Hebrew text successfully from a text_area component.

The error occurred because of this line:
app_tables.profile_data.add_row(email=user[‘email’], about=“שלום”)

it seems that it happens anytime I use Hebrew inside the code editor for example:
x = “שלום”

Thanks again!

ooo, I see what you mean. This might be one for the Anvil crew (@meredydd, @shaun or @daviesian)

I will continue to play throughout the evening but it looks like the editor itself doesn’t like it.

Ok, if I put that text into a textbox and add that, all is well.

So, this is looks like an issue with the IDE editor itself. Definitely one for Anvil Central.

Sorry I can’t help more.

that’s ok, I’ll just feed the text in the DB

Thank you very much :slight_smile: