This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Ramin Farajpour Cami
Recipients Ramin Farajpour Cami
Date 2015-09-11.23:37:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1442014666.01.0.500652392111.issue25075@psf.upfronthosting.co.za>
In-reply-to
Content
Hi,

issue from python in encode base64 with Json Model in twice encode with base64 output python different  with JAVA and C# , if programmer using rest-service in server side and other programmer using UI(Python Django) in client site , this encode different for encode and decode with match json encode model,


real example :

1- go to https://www.base64encode.org/ 
2- using {"userName":"admin","password":"admin"} (default UTF-8)
3-first encode oupput : "eyJ1c2VyTmFtZSI6ImFkbWluIiwicGFzc3dvcmQiOiJhZG1pbiJ9"
4-again second encode "eyJ1c2VyTmFtZSI6ImFkbWluIiwicGFzc3dvcmQiOiJhZG1pbiJ9" output :
"ZXlKMWMyVnlUbUZ0WlNJNkltRmtiV2x1SWl3aWNHRnpjM2R2Y21RaU9pSmhaRzFwYmlKOQ=="

now second output python json model : 

Microsoft Windows [Version 6.2.9200]
(c) 2012 Microsoft Corporation. All rights reserved.

C:\Users\Matthew F4rr3ll>python
Python 2.7.7 (default, Jun  1 2014, 14:21:57) [MSC v.1500 64 bit (AMD64)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> s1='{"userName":"admin","password":"admin"}'
>>> s2 = s1.encode("base64")
>>> e = s2.encode("base64")
>>> print e
ZXlKMWMyVnlUbUZ0WlNJNkltRmtiV2x1SWl3aWNHRnpjM2R2Y21RaU9pSmhaRzFwYmlKOQo=

>>>
>>>
>>>

now check this output : 
ZXlKMWMyVnlUbUZ0WlNJNkltRmtiV2x1SWl3aWNHRnpjM2R2Y21RaU9pSmhaRzFwYmlKOQo=
ZXlKMWMyVnlUbUZ0WlNJNkltRmtiV2x1SWl3aWNHRnpjM2R2Y21RaU9pSmhaRzFwYmlKOQ==

you see in two encode different in end line in ("o=" != "==")


also i know resolve this but you should fix in end line encode match with other language


Thanks,
Ramin
History
Date User Action Args
2015-09-11 23:37:46Ramin Farajpour Camisetrecipients: + Ramin Farajpour Cami
2015-09-11 23:37:46Ramin Farajpour Camisetmessageid: <1442014666.01.0.500652392111.issue25075@psf.upfronthosting.co.za>
2015-09-11 23:37:45Ramin Farajpour Camilinkissue25075 messages
2015-09-11 23:37:45Ramin Farajpour Camicreate