String encode and decode

Help
Robert
2012-01-31
2013-04-25
  • Robert

    Robert - 2012-01-31

    Hi,
    I am passing  data from one form tu another via onSave event using the url and for that I encoded the string because the string usually has latin characters:

    name=plominoDocument.getItem('employeeName')
    name=name.encode('latin-1')
    return plominoDocument.getParentDatabase().absolute_url()+'/form2/OpenForm?employeeName='+name
    

    But I get this error when saving the doc:

    UnicodeDecodeError: 'ascii' codec can't decode byte 0xf3 in position 57: ordinal not in range(128)
    
     
  • Eric Brehault

    Eric Brehault - 2012-01-31

    Hi,

    this should work:
    name=plominoDocument.getItem('employeeName')
    name=name.encode('latin-1')
    param = urlencode({'employeeName': name})
    return plominoDocument.getParentDatabase().absolute_url()+'/form2/OpenForm?='+param

    NOTE: we are about to close this SF forum, please use GitHub issues service
    to post questions:
    - go here: https://github.com/plomino/Plomino/issues
    - register
    - post your questions.

    Thank you

    Eric

     
  • Robert

    Robert - 2012-02-01

    Hi,

    I still get the error, it seems that the strings are encoded correctly and the parameter appears encoded in the url but it fails when trying to insert the parameter into the opening form.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks