FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Replace CR and new line with a 0x23CE character by TravisEz13 · Pull Request #10616 · PowerShell/PowerShell · GitHub

Replace CR and new line with a 0x23CE character - #10616

Merged
Aditya Patwardhan (adityapatwardhan) merged 8 commits into
PowerShell:masterfrom
TravisEz13:fix_linux_syslogs
Oct 7, 2019
Merged

Replace CR and new line with a 0x23CE character#10616
Aditya Patwardhan (adityapatwardhan) merged 8 commits into
PowerShell:masterfrom
TravisEz13:fix_linux_syslogs

Conversation

Travis Plunk (TravisEz13) commented Sep 24, 2019
edited
Loading

Copy link
Copy Markdown
Member

PR Summary

Replace CR and new line with a 0x23CE character

PR Context

Trying to document how to use logging with Azure Log Analytics and RSyslog converting these to #012 and #013

PR Checklist

Travis Plunk (TravisEz13) added the CL-Engine Indicates that a PR should be marked as an engine change in the Change Log label Sep 24, 2019
Travis Plunk (TravisEz13) changed the title Replace CR and new line with a 0x23CE character WIP: Replace CR and new line with a 0x23CE character Sep 24, 2019
textToLog = textToLog.Replace('\u0000', '\u2400');
#if UNIX
if (Platform.IsLinux)
{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This check is not needed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Why? This is only an issues for SysLog, not OsLog on macOS

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Got it. Closed

Ilya (iSazonov) Sep 26, 2019
edited
Loading

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

In the case it would be good to have the protection comment in the code.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I can repeat the comment if you want

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It is explained on line 1584

Copy link
Copy Markdown
Member

Talked with Travis Plunk (@TravisEz13) about the concern of creating 3 large strings for Linux when the script itself is large.
Travis Plunk (@TravisEz13) will update the code to address that concern.

Travis Plunk (TravisEz13) changed the title WIP: Replace CR and new line with a 0x23CE character Replace CR and new line with a 0x23CE character Oct 3, 2019
Comment thread test/powershell/Host/Logging.Tests.ps1 Outdated
[string] $powershell = Join-Path -Path $PSHome -ChildPath 'pwsh'
$scriptBlockCreatedRegExTemplate = @"
Creating Scriptblock text \(1 of 1\):#012{0}(`u{23CE}|\?|#012)*ScriptBlock ID: [0-9a-z\-]*#012Path:.*
Creating Scriptblock text \(1 of 1\):#012{0}(|#012)*ScriptBlock ID: [0-9a-z\-]*#012Path:.*

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Why do we need this? `u{23CE} looks more clear for me.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The tests fail if we use the escape sequence.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I tried to copy and paster the code in console and lost the char. Also the tests become unreadable. I wonder why doesn't the Unicode syntax sugar work?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Ilya (@iSazonov) that's going to vary by the font you use. I worked with Rob Holt (@rjmholt) to come up with this solution. The previous solution that was working, was actually just looking for a ? which is less specific.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I remember that we had Unicode chars in files and it was a headache - editors silently break them. After that we made a conclusion to keep all files in ASCII.

Aditya Patwardhan (adityapatwardhan) merged commit bf91246 into PowerShell:master Oct 7, 2019
Travis Plunk (TravisEz13) deleted the fix_linux_syslogs branch October 7, 2019 18:44

Copy link
Copy Markdown

🎉v7.0.0-preview.5 has been released which incorporates this pull request.:tada:

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Engine Indicates that a PR should be marked as an engine change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL