Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7743] Android: encodeURIComponent returns odd String

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-07-05T04:52:30.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sSprint 2012-04, Release 2.0.0
ComponentsAndroid
Labelsmodule_app_properties, qe-testadded
ReporterMarshall Culpepper
AssigneePing Wang
Created2012-02-21T16:08:10.000+0000
Updated2012-07-05T16:06:29.000+0000

Description

When using encodeURIComponent, the return value from Android's Uri.encode seems to be good while debugging, but the JS return value that gets printed doesn't seem to be correct. It seems there is an error in the binding layer somewhere.. Code:
Ti.API.debug(encodeURIComponent("üöäß &?/ tes tetst et st e\ntest etes te stet"));
Log:
02-21 18:07:37.930: D/TiAPI(22633): 1.817237E+132FBFBD1.104170E-317FBFBD1.811392E+132FBFBD2.164448E-312FBFBD                   %26  F F       5.034598e-308s       3.022026e+132tst       3.321918e+133t                    t       5.585349e-308Atest       5.034598e-308tes       1.301351e+132YC�8��:��:Q��&�&!`�&嚿&���&嚿&嚿&tet
Expected Value:
%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%20%26%3F%2F%20tes%20tetst%20et%20st%20e%0Atest%20etes%20te%20stet

Comments

  1. Ping Wang 2012-02-23

    Testing code
       var code = encodeURIComponent("üöäß &?/ tes tetst et st e\ntest etes te stet");
       Ti.API.debug("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
       Ti.API.trace("" + code);
       Ti.API.debug("" + code);
       Ti.API.info("" + code);
       Ti.API.notice("" + code);
       Ti.API.warn("" + code);
       Ti.API.error("" + code);
       Ti.API.critical("" + code);
       Ti.API.fatal("" + code);
       Ti.API.debug("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
       
    Run the above code. The expected output is
       D/TiAPI   ( 1085): <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
       V/TiAPI   ( 1085): %C3%BC%C3%B6%C3%A4%C3%9F%20%26%3F%2F%20tes%20tetst%20et%20st%20e%0Atest%20etes%20te%20stet
       D/TiAPI   ( 1085): %C3%BC%C3%B6%C3%A4%C3%9F%20%26%3F%2F%20tes%20tetst%20et%20st%20e%0Atest%20etes%20te%20stet
       I/TiAPI   ( 1085): %C3%BC%C3%B6%C3%A4%C3%9F%20%26%3F%2F%20tes%20tetst%20et%20st%20e%0Atest%20etes%20te%20stet
       I/TiAPI   ( 1085): %C3%BC%C3%B6%C3%A4%C3%9F%20%26%3F%2F%20tes%20tetst%20et%20st%20e%0Atest%20etes%20te%20stet
       W/TiAPI   ( 1085): %C3%BC%C3%B6%C3%A4%C3%9F%20%26%3F%2F%20tes%20tetst%20et%20st%20e%0Atest%20etes%20te%20stet
       E/TiAPI   ( 1085): %C3%BC%C3%B6%C3%A4%C3%9F%20%26%3F%2F%20tes%20tetst%20et%20st%20e%0Atest%20etes%20te%20stet
       E/TiAPI   ( 1085): %C3%BC%C3%B6%C3%A4%C3%9F%20%26%3F%2F%20tes%20tetst%20et%20st%20e%0Atest%20etes%20te%20stet
       E/TiAPI   ( 1085): %C3%BC%C3%B6%C3%A4%C3%9F%20%26%3F%2F%20tes%20tetst%20et%20st%20e%0Atest%20etes%20te%20stet
       D/TiAPI   ( 1085): <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
       
  2. Wilson Luu 2012-03-16

    Closing bug. Verified fix on: SDK build: 2.0.0.v20120316124800 Runtime: v8, rhino Titanium Studio, build: 2.0.0.201203152033 Device: Nexus S (2.3.6)
  3. Neha Chhabra 2012-07-05

    Reopening to update labels.

JSON Source