GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Allow numeric Ids and name of registered code pages in '-Encoding' parameters by iSazonov · Pull Request #7636 · PowerShell/PowerShell

Conversation

@iSazonov

@iSazonov Ilya (iSazonov) commented Aug 27, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

PR Summary

Address #6581.

The PR enhance the encoding transformation attribute:

  • to allow numeric Ids of registered code pages (like -Encoding 1251)
  • to allow string names of registered code pages (like -Encoding "windows-1251")

Full list supported code pages we can found in
https://github.com/dotnet/corefx/blob/0b0f63d47951773cc46393312d80b40176d3a413/src/System.Text.Encoding.CodePages/src/System/Text/EncodingTable.Data.cs

We haven't encoding test at all so I tested the change locally.

Set-Content -Path .\test1.txt -Value "я" -Encoding 1251
Set-Content -Path .\test2.txt -Value "я" -Encoding "windows-1251"

PR Checklist

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • Change is not breaking
  • Make sure all .h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header
  • This PR is ready to merge and is not Work in Progress.
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready.
  • User-facing changes
    • Not Applicable
    • OR
    • User-facing Documentation needed
      • Issue filed - Issue link: Encoding parameter accept numeric Ids and name of registered code pages MicrosoftDocs/PowerShell-Docs#2937
  • Testing - New and feature
    • Not Applicable or can only be tested interactively
    • OR
    • Make sure you've added a new test if existing tests do not effectively test the code changed
      • Add [feature] if the change is significant or affects feature tests

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iSazonov Ilya (iSazonov) self-assigned this Aug 27, 2018
@iSazonov
Ilya (iSazonov) requested review from James Truher (JamesWTruher) and Steve Lee (SteveL-MSFT) August 27, 2018 07:31
@iSazonov
Ilya (iSazonov) force-pushed the encoding-enhance branch from cebaad2 to edc51a7 Compare September 10, 2018 04:03
@iSazonov

Ilya (iSazonov) commented Sep 10, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator Author

Travis Plunk (@TravisEz13) Could you please look why PowerShell-CIs failed on Update-Help tests? (Nightly Travis CI failed too).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@TravisEz13

Travis Plunk (TravisEz13) commented Sep 13, 2018

Copy link
Copy Markdown
Member

there were connection issues to download.microsoft.com... The PR should be rebased.

iSazonov reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iSazonov
Enhance encoding transformation
855dd2d
@iSazonov
Ilya (iSazonov) force-pushed the encoding-enhance branch from edc51a7 to 855dd2d Compare September 14, 2018 03:33
@iSazonov

Ilya (iSazonov) commented Sep 14, 2018

Copy link
Copy Markdown
Collaborator Author

Rebased to fix CIs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

TravisEz13
Travis Plunk (TravisEz13) reviewed Sep 14, 2018
View reviewed changes
Comment thread src/System.Management.Automation/utils/EncodingUtils.cs
{
return System.Text.Encoding.GetEncoding(stringName);
}
case int intName:

@TravisEz13 Travis Plunk (TravisEz13) Sep 14, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Can you add some tests for the int case?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@iSazonov Ilya (iSazonov) Sep 17, 2018

Copy link
Copy Markdown
Collaborator Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Added.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
TravisEz13
Travis Plunk (TravisEz13) requested changes Sep 14, 2018
View reviewed changes

@TravisEz13 Travis Plunk (TravisEz13) left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

see comments

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Ilya (iSazonov) added 2 commits September 17, 2018 09:57
@iSazonov
Add test
808d246
@iSazonov
Fix test
d3b1e4e
TravisEz13
Travis Plunk (TravisEz13) reviewed Sep 17, 2018
View reviewed changes
Comment thread test/powershell/engine/Basic/Encoding.Tests.ps1
BeforeAll {
$testValue = "ф"
if ($IsWindows) {
$expectedBytes = 244,13,10 -join "-"

@TravisEz13 Travis Plunk (TravisEz13) Sep 17, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Add a comment about what the characters are

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@iSazonov Ilya (iSazonov) Sep 18, 2018

Copy link
Copy Markdown
Collaborator Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Added.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
TravisEz13
Travis Plunk (TravisEz13) approved these changes Sep 17, 2018
View reviewed changes

@TravisEz13 Travis Plunk (TravisEz13) left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

One comment about the expected characters

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iSazonov
Add comment
9a181a1
@iSazonov Ilya (iSazonov) added the Documentation Needed in this repo Documentation is needed in this repo label Sep 18, 2018
TravisEz13
Travis Plunk (TravisEz13) approved these changes Sep 18, 2018
View reviewed changes
@TravisEz13

Travis Plunk (TravisEz13) commented Sep 18, 2018

Copy link
Copy Markdown
Member

Ilya (@iSazonov) Have you filed a doc issue?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iSazonov Ilya (iSazonov) mentioned this pull request Sep 19, 2018
Encoding parameter accept numeric Ids and name of registered code pages MicrosoftDocs/PowerShell-Docs#2937
Closed
2 of 8 tasks
@iSazonov

Ilya (iSazonov) commented Sep 19, 2018

Copy link
Copy Markdown
Collaborator Author

Travis Plunk (@TravisEz13) Doc issue was created.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iSazonov
Ilya (iSazonov) merged commit cc5f36c into PowerShell:master Sep 19, 2018
@iSazonov
Ilya (iSazonov) deleted the encoding-enhance branch September 19, 2018 13:53
@joeyaiello Joey Aiello (joeyaiello) mentioned this pull request Oct 15, 2018
Docs needed for 'Allow numeric Ids and name of registered code pages in '-Encoding' parameters' MicrosoftDocs/PowerShell-Docs#3027
Closed
@joeyaiello Joey Aiello (joeyaiello) removed Documentation Needed in this repo Documentation is needed in this repo labels Oct 15, 2018
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
@iSazonov
Allow numeric Ids and name of registered code pages in '-Encoding' pa…
80bd45c
…rameters (PowerShell#7636)

Enhance the encoding transformation attribute:
- to allow numeric Ids of registered code pages (like -Encoding 1251)
- to allow string names of registered code pages (like -Encoding "windows-1251")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@TravisEz13 Travis Plunk (TravisEz13) TravisEz13 approved these changes
@JamesWTruher James Truher (JamesWTruher) Awaiting requested review from JamesWTruher
@SteveL-MSFT Steve Lee (SteveL-MSFT) Awaiting requested review from SteveL-MSFT

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@iSazonov Ilya (iSazonov)

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@iSazonov @TravisEz13 @joeyaiello
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.