Cannot save Greek in data warehouse

I have a serious problem with my app for Google apps. So far, everything that I have stored in the database has been in English. Now I have to store several things in Greek, and when I try to get it later from the database, instead of the line, enter "u" \ u039a \ u03b1 \ u03b9 \ u03c1 \ u03cc \ u03c2 '.

Until now, when I wanted to put something in html, I used the following

error = unicode(error,"utf-8") 

But I tried this to put it directly before storing it on data, but it doesn't help

Edit:

I just see what bothers me more. I get these lines from an html form. I have many resources where the Greeks work great. But those that create the problem are in the "select" tag, where I get a list of all the selected ones. Other entries stored in the Greek database are no problem.

Edit 2:

I want to change something from the comments. I made a mistake. If I print a variable, I see the line without any problems. But if I myself .response.out.write (thestring), I see% CE% 9A% CE% BF% CE% B9% CE% BD% CF% 89% CE% BD% CE% B9% CE% BA% CE % AC

+4
source share
1 answer

I can store and retrieve Greek in the Google engine, but this did not work for me until I did this:

name = unicode(form.name.data, "utf8")

I can store Greek in the Google engine, so why not do it the way I do. This is easier said than done, but use utf-8 everywhere, and then it will work. You will need the code for your web pages:

<html><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

You may also need to specify your input form for encoding as utf-8, but I do not do this with appengine, and still can store Greek. I just found it experimentally, if you need a theory, you can read these slides .

0
source

Source: https://habr.com/ru/post/1484682/


All Articles