Issue Description
Trying to encode the string using Ti.Utils.base64enocde method as below,
Ti.Utils.base64encode('Test実験室じっけんしつ').
It returns the encoded string :
VGVzdOWun+mok+WupA==
But trying to encode the same string in
https://www.base64encode.org/
returns the encoded string : VGVzdOWun+mok+WupOOBmOOBo+OBkeOCk+OBl+OBpA==
Ti.Utils.base64encode method encodes the partial string only.
Steps to reproduce/Testcase
Create a new classic default application
open the app.js file
replace the code
var win = Ti.UI.createWindow({backgroundColor:"white"});
var testStr = "Test実験室じっけんしつ";
var encoded = Ti.Utils.base64encode(testStr);
Ti.API.info(encoded);
win.open();
#Run
The return string don't match with the
https://www.base64encode.org/ string
Workaround:
[~emerriman] We should do this together with the related issues (TIMOB-16606, TIMOB-15590) and TIMOB-9111 which would be a breaking change by removing the "\n" characters from the string. I would do it for 7.0.0 then, but if this urges, we can do the encoding fix before and the new-line changes in 7.0.0. *EDIT*: TIMOB-9111 is ready for review and will be part of 7.0.0. In the mean-time, here is a tiny Hyperloop solution that can be used to use the correct encoding today - without an SDK upgrade or native module:
Closing as a duplicate. If this is in error, please reopen.