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

Add encoding utils in core utils #26592

Merged
merged 13 commits into from
Aug 2, 2023

Conversation

qiaozha
Copy link
Member

@qiaozha qiaozha commented Jul 24, 2023

Partially fix Azure/autorest.typescript#1933
Add some helper function in core-util to support converter from bytes array to string with different kinds of character encoding. Currently only support base64 and utf-8 and base64url. which should be able to work in both Node environment and browser environment.

We will need to wait for typespec team's response to see if we need to support more. issue tracked here microsoft/typespec#2204

@qiaozha qiaozha changed the title Add encoding utils in core client rest Add encoding utils in core utils Jul 24, 2023
@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure-core-util

Copy link
Member

@xirzec xirzec left a comment

Choose a reason for hiding this comment

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

Minor remarks, but otherwise seems good.

@mpodwysocki I think you looked at doing this before, any feedback before we merge?

sdk/core/core-util/src/bytesEncoding.browser.ts Outdated Show resolved Hide resolved
sdk/core/core-util/src/bytesEncoding.browser.ts Outdated Show resolved Hide resolved
@mpodwysocki
Copy link
Member

Minor remarks, but otherwise seems good.

@mpodwysocki I think you looked at doing this before, any feedback before we merge?

@xirzec The only feedback I have is that atob and btoa are also available in Node.js as of v16, so we may not need a split between the two at some point soon.

@qiaozha qiaozha merged commit 4c113a1 into Azure:main Aug 2, 2023
13 checks passed
dgetu pushed a commit that referenced this pull request Sep 6, 2023
Partially fix Azure/autorest.typescript#1933 
Add some helper function in core-util to support converter from bytes
array to string with different kinds of character encoding. Currently
only support base64 and utf-8 and base64url. which should be able to
work in both Node environment and browser environment.

We will need to wait for typespec team's response to see if we need to
support more. issue tracked here
microsoft/typespec#2204

---------

Co-authored-by: Jeff Fisher <xirzec@xirzec.com>
@qiaozha qiaozha deleted the add-encoding-utils-in-core-client-rest branch September 20, 2023 23:40
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.

We are missing a serialize function in the modular layer
5 participants