Skip to content

[vs17.9] [ClickOnce] [GB18030] Workaround for incorrect encoding of chars in the PUA range of file paths #9669

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

Merged
merged 4 commits into from
Jan 26, 2024

Conversation

sujitnayak
Copy link
Contributor

@sujitnayak sujitnayak commented Jan 20, 2024

Fixes #
AB#1939151

Summary

Uri class when passed a GB18030 string with chars in the PUA range incorrectly encodes the PUA chars.
For e.g. if the PUA char is u+e038, Uri encodes it in UTF-8 as %25EE%2580%25B8 instead of %EE%80%B8 by double encoding the %.

The ClickOnce scenario that is failing is when an app's Installation Uri is set to a UNC path that has PUA chars. In this case, the UNC path is written to the Clickonce manifest. When the app is being installed, ClickOnce Runtime will attempt to download the deployment manifest from the UNC path. Since the Uri is incorrectly encoded, this download will fail.

Changes Made

The FormatUrl function is being updated to resolve this issue. This function takes input path as string and return a canonicalized path by constructing a Uri class with the input path and then returning it's AbsoluteUri property.

In the case where the Uri's Scheme is File (file://), the function will now check if there are non-ascii characters in it and if so, create a new Uri with the UriBuilder class. The Uri created by UriBuilder correctly handles PUA range in GB18030.

Customer Impact

ClickOnce apps published with Installation path set to a UNC path containing GB18030 + PUA chars will be installed correctly after this change.

Testing

Failing scenario has been validated and CTI team has run regression tests on affected scenarios (scenarios where Uri are used for publishing).

Notes

@ghost
Copy link

ghost commented Jan 20, 2024

Hello! I noticed that you're targeting one of our servicing branches. Please consider updating the version.

@JanKrivanek JanKrivanek changed the title [ClickOnce] [GB18030] Workaround for incorrect encoding of chars in the PUA range of file paths [vs17.9] [ClickOnce] [GB18030] Workaround for incorrect encoding of chars in the PUA range of file paths Jan 23, 2024
@ghost
Copy link

ghost commented Jan 23, 2024

Hello! I noticed that you're targeting one of our servicing branches. Please consider updating the version.

Copy link
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

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

Overall looks good - I have minor comments

@sujitnayak sujitnayak requested a review from a team as a code owner January 23, 2024 20:05
Copy link
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

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

(already reviewed - but reviewing as explicitly requested kitten)

Copy link
Member

@AR-May AR-May left a comment

Choose a reason for hiding this comment

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

Overall looks good to me.

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

Successfully merging this pull request may close these issues.

7 participants