python - Greek characters in html forms and storing to variables -


i trying make html page have interaction sql database.i using python language , bottle+pymysql . want form accept greek characters , can put them variables , later use them database.i using accept charset in form not sure , does't work , too.

for example,i name = 'ΟΝΟΜΑ' surname = 'ΕΠΙΘΕΤΟ'

my code works english input , database contains greek it's real need.

@app.route('/b1') # or @route('/login') def b1():     return '''         <form action="/b1" method="post" accept-charset="foobar utt-8" >             name           : <input name="name" type="text" /><br>             surname        : <input name="surname" type="text" /><br>             birth year-from: <input name="from" type="text" /><br>             birth year-to  : <input name="to" type="text" /><br>             <input value="submit" type="submit" />         </form> '''  @app.post('/b1',method='post') # or @route('/login', method='post') def do_b1():     name = request.forms.get('name')     surname = request.forms.get('surname')     dfrom = request.forms.get('from')     dto = request.forms.get('to')     try:        query = '...'        curs.execute(query)    except:        yield "\n failed data base<br/>"    yield name    yield surname    yield dfrom    yield dto 


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -