[web2py] Encoding datetime and uft chars with json

2019-09-01 Thread Attique Tecnologia
Hello my friends. I have a problem with json, charset, and python date and time encoding. My goal is to use web2py rows (db().select()) to simplify my work, but I not find the best way made. See. import json # Not suport python datetime. from gluon.contrib.simplejson import JSONEncoder #Not supor

[web2py] Encoding problem with a web2py application that implements an XMLRPC webservice

2019-07-04 Thread Lisandro
I need to understand if this is a bug or if it is the expected behaviour and I'm doing something wrong. I have two web2py applications. One of them implements an XMLRPC webservice, and the other one consumes it. All the controllers (in both applications) have this first line: # -*- coding: utf-

[web2py] encoding form fields when registering user - bug or feature?

2017-05-07 Thread Yebach
Hello I just discovered the following behavior when user fills the user registration form in my form i have confirm password. and in storage the following values are stored , 'email': 'test_m...@gmail.com'}> as you can see the password_two is not encrypted. In case i forgot to set the encr

Re: [web2py] Encoding while reading postgres data

2016-01-20 Thread Richard Vézina
You need XML() web2py helper when you pass python string or generate js code from python you need it... In the view : {{=XML(python_var_containing_text_or_js_code}} Richard On Wed, Jan 20, 2016 at 4:52 AM, Yebach wrote: > In this case I get the list of string > > users = [u'Ga\u0161peri\u010d

Re: [web2py] Encoding while reading postgres data

2016-01-20 Thread Yebach
Solved the problem I posted on stackoverflow.com http://stackoverflow.com/questions/34596573/javascript-string-encoding-on-client vote up or correct if it is not ok On Wednesday, January 20, 2016 at 3:41:13 PM UTC+1, Richard wrote: > > You need XML() web2py helper when you pass python string o

Re: [web2py] Encoding while reading postgres data

2016-01-20 Thread Yebach
In this case I get the list of string users = [u'Ga\u0161peri\u010d', u'GovednikK', u'Jam\u0161ek', u'Jurejev\u010di\u010d', u'Kati\u0107', u'Kostelec', u'Ko\u0161ele', u'Male\u0161i\u010d', u'Muhi\u010d', u'Re\u017eek', u'Sitar', u'Toma\u017ei\u010d', u'Viktorovski', u'Vuk\u0161ini\u010dD',

Re: [web2py] Encoding while reading postgres data

2016-01-04 Thread Richard Vézina
>From js directly? I not really good with js but I guess there is encoding too... From web2py you can't since everything use byte (str('byte string')) and not unicode (u'your properly encoded string')... So if you pass data from web2py what I showed you is the way of doing it... Richard On Mon, J

Re: [web2py] Encoding while reading postgres data

2016-01-04 Thread Yebach
Ok, but I would like to already see the right endocing when I get data from server database? On Monday, January 4, 2016 at 5:39:32 PM UTC+1, Richard wrote: > > When passing data from python to javascript I guess you will need to use > unicode or decode > > try > > javascritp_string_var = s.dec

Re: [web2py] Encoding while reading postgres data

2016-01-04 Thread Richard Vézina
When passing data from python to javascript I guess you will need to use unicode or decode try javascritp_string_var = s.decode('utf8') Or javascritp_string_var = unicode(s, 'utf8') Richard On Mon, Jan 4, 2016 at 11:34 AM, Yebach wrote: > Hello > > I have the following scenario. > > Databa

[web2py] Encoding while reading postgres data

2016-01-04 Thread Yebach
Hello I have the following scenario. Database is PostgreSQL, encoding set to UTF-8 When I read data from database with web2py I get a string reading in type of *Bolni\xc4\x8dar* where it was suppose to be *Bolničar*. Now, when i use web2py to present data in my view is all fine (so I can see

[web2py] Encoding-related exceptions produced when doing DB inserts or lookups

2015-10-24 Thread Spokes
An application has suddenly started generating exceptions pertaining to encoding, when I attempt to perform database inserts or lookups. The lookup operation produces this exception: 3. Exception in 'Agent_Base check_comparable_record_exists_in_db()': 'ascii' codec can't decode byte 0xe2 in po

[web2py] Encoding and 'invalid argument'

2014-07-31 Thread Rémy Reche
I am using the decorator @request.restful() in order to implement a rest API. Unfortunatly, one on my function take an argument which can contain non-ascii character, for instance 'Gymnase Joseph Guétat'. Each request using this string returns a web2py error with the following comment: invalid

[web2py] Encoding problem in 'format' from define_table on GAE

2013-08-15 Thread juan
Hello, It seems that the format option in db.define_table isn't working properly when deployed on GAE. Please, consider these two tables: db.define_table('ingrediente', Field('nombre', 'string', requires=IS_NOT_EMPTY(error_message='Se ha de indicar el nombre')),

[web2py] encoding problem in GAE when using format in db.define_table

2013-08-15 Thread juanchín chin chin
It seems that something isn't working properly when using the attribute 'format' and not-only English chars on db.define_table when deployed on GAE Please, consider theses two table definitions: db.define_table('ingrediente', Field('nombre', 'string', requires=IS_NOT_EMPTY(error_m

[web2py] Encoding works on production but fails in development

2012-12-27 Thread Felipe Meirelles
I'm using GAE + Google Cloud SQL and when I insert some data to local server with special chars like in "Água" it saves the data, but when i try to retrieve it i get an encoding error from python. In production it is automaticaly encoded to \u00c1gua and saves to DB. Is it some mysql feature tha

[web2py] Encoding and cp1252

2012-07-01 Thread Matt
Hi there, I'm using web2py on GAE and have recently run into some problems with cp1252 characters being submitted via cut and posted text in forms. At present whenever this happens I get exceptions complaining that the string isn't valid unicode. Looking through the web2py codebase I can see t

[web2py] Encoding and cp1252

2012-07-01 Thread Matt
Hi there, I'm using web2py on GAE and have recently run into some problems with cp1252 characters being submitted via cut and posted text in forms. At present whenever this happens I get exceptions complaining that the string isn't valid unicode. Looking through the web2py codebase I can see t

Re: [web2py] encoding

2011-09-12 Thread Richard Vézina
Are you talking about the URL? If yes read this : http://groups.google.com/group/fameisfame/browse_thread/thread/081461db3d72c14b Richard On Sat, Sep 10, 2011 at 2:14 PM, Emy wrote: > hey all > my website is dealing with arabic characters and I have a problem with > encoding I can read from DB

[web2py] encoding

2011-09-10 Thread Emy
hey all my website is dealing with arabic characters and I have a problem with encoding I can read from DB wothout problem when I try to insert any data using ajax function I got the string written like that in python : "%D8%A8%D8%A8%D9%8A%D9%8A%D9%8A%D8%B3%D8%B3%'" when I try to write : txt=unic

[web2py] encoding problem

2011-03-10 Thread Eduardo
Hi, I modified the insert( ) function of appadmin.py from the example app by passing a dict to the labels attribute of SQLFORM( ) - in other words: appadmin.py > insert( ) > SQLFORM(.. labels=dict) The labels, with Portuguese characters, are not correctly encoded on the final result. Note th

[web2py] encoding problem

2011-01-26 Thread Marin Pranjic
It's not web2py related, but I hope someone can help me. I'm sending data via ajax, which is urlencoded JSON object (I used jquery-json). Then, I use json.loads(variable) to load the object. Everything works good for normal ASCII characters, but if I send non- ascii chars, i get the following: U

[web2py] encoding and decoding spaces in request.args

2010-12-20 Thread Hasanat Kazmi
Hey, I am generating URLs on the go and then decoding when they are called by user. e.g. application/controller/funtion/foo/bar/. I encode foo and bar individually so that if they have spaces, they get encoded to %20 not _ which seems liked default. but when I decode it (After user calls it

[web2py] Encoding using as_dict not using UTF-8?

2010-04-10 Thread Tito Garrido
Hi Folks, I'm not sure why but when I'm using as_dict function in a row element it's not returning UTF-8 characters an example: db.define_table('evento', SQLField('dono','reference auth_user',writable=False,readable=False), SQLField('paciente', 'reference paciente', label='Paciente*'),