Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIMOB-9395: Blackberry: implement decode/encode URIComponent #75

Closed

Conversation

alexandergalstyan
Copy link

Reviewers: DavidC, JP

ChangeLog:

  • Implement decode/encode URIComponent
  • Global.yml apidoc updated

Test Cases:

  • Using sample tibbtest project create var with the value of: 'http://www.example.com/List%20of%20holidays.xml'
  • Using sample tibbtest project create var with the value of: 'http%3A%2F%2Fwww.e.com%2F%E3%81%93%E3%82%8C%E3%81%AF%E3%80%81%E3%81%93%E3%82%8C%E3%82%92%E6%97%A5%E6%9C%AC%E4%BA%BA%E3%81%AE%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%81%A7%E3%81%99'
  • Use decodeURIComponent to decode the uri.
  • Make sure it decodes successfully.
  • Using sample tibbtest project create var with the value of: 'http://www.example.com/List of holidays.xml'
  • Using sample tibbtest project create var with the value of: 'http://www.e.com/これは、これを日本人のテキストです'
  • Use encodeURIComponent to encode the uri.
  • Make sure it encodes successfully.
  • Validate the following url: 'www.e.com/A-_75'.!~*()'. Make sure characters not escaped.

unknown added 3 commits June 9, 2012 15:28
…rry' into formatReview

#Some more info....
Reviewers: DavidC, JP

ChangeLog:
- Implement decode/encode URIComponent

Test Cases:
- Using sample tibbtest project create var with the value of:
  'http://www.example.com/List%20of%20holidays.xml'
- Use decodeURIComponent to decode the uri.
- Make sure it decodes successfully.
- Using sample tibbtest project create var with the value of:
    'http://www.example.com/List of holidays.xml'
- Use encodeURIComponent to encode the uri.
- Make sure it encodes successfully.
@jpl-mac
Copy link

jpl-mac commented Jun 11, 2012

Your test cases only test encoding and decoding spaces, i don't think that's a complete test set for this functionality. aren't there many more characters/symbols that need to be supported by this method?

@@ -116,14 +120,34 @@ int TiRootObject::executeScript(NativeObjectFactory* objectFactory, const char*

Handle<Value> TiRootObject::_decodeURIComponent(void* userContext, TiObject* caller, const Arguments& args)
{
// TODO: finish this
return Undefined();
if (args.Length() < 1 || (!args[0]->IsString() && !args[0]->IsStringObject()))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a TODO note to test using StringObjects, as we currently don't have them working and therefore cannot test them. Same for encodeURIComponent

That is unless you know a way to test with StringObjects, in which case i'm interested to know how.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO added

@jpl-mac
Copy link

jpl-mac commented Jun 11, 2012

Update the apidoc

@jpl-mac
Copy link

jpl-mac commented Jun 11, 2012

Reviewed

Reviewers: DavidC, JP

ChangeLog:
- Implement decode/encode URIComponent
- Updated Global.yml apidoc

Test Cases:
- Using sample tibbtest project create var with the value of: 'http://www.example.com/List%20of%20holidays.xml'
- Use decodeURIComponent to decode the uri.
- Make sure it decodes successfully.
- Using sample tibbtest project create var with the value of: 'http://www.example.com/List of holidays.xml'
- Using sample tibbtest project create var with the value of: 'http://www.e.com/?????????????????'
- Use encodeURIComponent to encode the uri.
- Make sure it encodes successfully.
@alexandergalstyan
Copy link
Author

Updated

@jpl-mac
Copy link

jpl-mac commented Jun 12, 2012

Code looks good.

encodeURIComponent escapes all characters except the following: alphabetic, decimal digits, - _ . ! ~ * ' ( )

I'd like to see from your tests that you verified that the decimal digits and - _ . ! ~ * ' ( ) characters are indeed not escaped

@alexandergalstyan
Copy link
Author

Validated for 'www.e.com/A-_45'.!~*()' url. Characters not escaped.

@jpl-mac
Copy link

jpl-mac commented Jun 13, 2012

Approved, depends on PR #72 to be merged first

…rry' into formatReview

#Some more info....
@alexandergalstyan
Copy link
Author

Merged with upstream

@dcampbell-macadamian
Copy link

reviewed

Reviewers: DavidC, JP

ChangeLog:
- Address comments

Test Cases:
- Using sample tibbtest project create var with the value of: 'http://www.example.com/List%20of%20holidays.xml'
- Using sample tibbtest project create var with the value of: 'http%3A%2F%2Fwww.e.com%2F%E3%81%93%E3%82%8C%E3%81%AF%E3%80%81%E3%81%93%E3%82%8C%E3%82%92%E6%97%A5%E6%9C%AC%E4%BA%BA%E3%81%AE%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%81%A7%E3%81%99'
- Use decodeURIComponent to decode the uri.
- Make sure it decodes successfully.
- Using sample tibbtest project create var with the value of: 'http://www.example.com/List of holidays.xml'
- Using sample tibbtest project create var with the value of: 'http://www.e.com/?????????????????'
- Use encodeURIComponent to encode the uri.
 -Make sure it encodes successfully.
- Validate the following url: 'www.e.com/A-_75\'.!~*()'. Make sure characters not escaped.
@alexandergalstyan
Copy link
Author

Updated

@dcampbell-macadamian
Copy link

approved

@alexandergalstyan
Copy link
Author

Closing PR based on that fact that encodeURIComponent/decodeURIComponent built-ins are now available and usable.
Tests specified within PR description passed successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants