Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Input from form, GAE, wrong

By some reason, I am getting strange input for Cyrillic symbols in GAE.

In local environment all works fine, I get what was in input field, with self.request.get(''). But on Appspot, I get "1mxt1czq0snfzq==" or "0ylqtdgb0yi=" for example, instead of Russian words.

in .py

!/usr/bin/env python
-*- coding: utf-8 -*-
title = self.request.get('title')

in .html

meta charset="utf-8"
input type="text" name="title" id="title"

I'm stuck.

EDIT: Yes, it is Base64, you are right. But why is GAE using it? And where to change it? Why the different behavior in local and in Appspot?

In same form I'm trying to get the file to BlobHandler

<form class="form-horizontal" action="{{ upload_url }}" method="POST" enctype="multipart/form-data">
  <div class="control-group">
    <label class="control-label" for="title">Title</label>
    <div class="controls">
      <input type="text" name="title" id="title">
    </div>
  </div>
  <div class="control-group">
    <label class="control-label" for="file">Load image</label>
    <div class="controls">
      <input type="file" name="file" id="file" accept='image/*' required="required">
    </div>
  </div>

EDIT2: Yes. https://code.google.com/p/googleappengine/issues/detail?id=2749

Seems like a bug in GAE with BlobHandler.

Solution: accept-charset="utf-8" in form, trying that later.

like image 514
Pavel Kulikov Avatar asked Jan 05 '13 15:01

Pavel Kulikov


1 Answers

Bug: https://code.google.com/p/googleappengine/issues/detail?id=2749

accept-charset="utf-8" in form dont work.

Solution: in app.yaml add library

- name: webob
  version: "1.2.3"
like image 115
Pavel Kulikov Avatar answered Oct 23 '22 03:10

Pavel Kulikov