Replace CR and new line with a 0x23CE character#10616
Replace CR and new line with a 0x23CE character#10616adityapatwardhan merged 8 commits intoPowerShell:masterfrom
Conversation
src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs
Outdated
Show resolved
Hide resolved
| textToLog = textToLog.Replace('\u0000', '\u2400'); | ||
| #if UNIX | ||
| if (Platform.IsLinux) | ||
| { |
There was a problem hiding this comment.
Why? This is only an issues for SysLog, not OsLog on macOS
There was a problem hiding this comment.
In the case it would be good to have the protection comment in the code.
There was a problem hiding this comment.
I can repeat the comment if you want
There was a problem hiding this comment.
It is explained on line 1584
src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs
Outdated
Show resolved
Hide resolved
|
Talked with @TravisEz13 about the concern of creating 3 large strings for |
src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs
Outdated
Show resolved
Hide resolved
| [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:.* |
There was a problem hiding this comment.
Why do we need this? `u{23CE} looks more clear for me.
There was a problem hiding this comment.
The tests fail if we use the escape sequence.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
|
🎉 Handy links: |
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
#012and#013PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.