Thank you Alberto! Works nicely.

Just for the sake of the history: I have made a test with just two
unicode fields, using the UnicodeString validator from formencode.

 If I fill just the first field, if gets ok. If I fill both, it gets
ok. If I fill just the second, and left the first empty. But, if I
fill the second field, but not the first, it shows 'Internal Server
Error' on the screen and 'UnicodeDecodeError: 'ascii' codec can't
decode byte 0xc3 in position 0: ordinal not in range(128)' . Looks to
me that if the first field is not filled, the encoding of the field
falls back to the system default.

But, the UnicodeString from toscawidgets works nice!

Thank you!

[]'s
- Walter

On 7/31/07, Alberto Valverde <[EMAIL PROTECTED]> wrote:
>
>
> On Jul 30, 2007, at 10:17 PM, Walter Cruz wrote:
>
> >
> > Hi Neil.
> >
> > An example, using a form that i have build. How can I pass a accented
> > char to form and don't get a 'Internal Server Error'?
> >
> > []'s
> > - Walter
> >
> > # -*- coding: utf-8 -*-
> > """
> > Simplest WSGI app using Paste and ToscaWidgets
> >
> > Based on script by James Gardner
> > """
> > from pkg_resources import require
> > require('Paste', 'twForms >= 0.1a2dev_r2479')
> >
> > import formencode
> > from pprint import pformat, pprint
> > from genshi.template import Context, MarkupTemplate
> > from genshi.output import DocType
> > from formencode import Invalid
> > from paste.wsgiwrappers import WSGIRequest
> > from toscawidgets.widgets.forms import calendars
> >
> > from toscawidgets.api import retrieve_resources, WidgetsList
> > from toscawidgets.widgets.forms import TableForm,HiddenField,
> > TextField,SingleSelectField
> >
> > class UsuarioToscaForm(TableForm):
> >     class fields(WidgetsList):
> >         id = HiddenField(default=0)
> >         matricula = TextField(label_text = u'Matr�cula', validator =
> > formencode.validators.UnicodeString(not_empty=True))
> > (......)
>
> I believe this is related to the issue discussed in this thread [1].
> Try using toscawidgets.widgets.forms.validadors.UnicodeString instead
> of the one provided by formencode.
>
> HTH,
> Alberto
>
> [1] http://tinyurl.com/3dgqzq
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to