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
Need a full set of encoding tests #3488
Comments
The test snippet tests how PowerShell itself reads source code that has no BOM, so can you please add that as a separate action item (check box) to the list of tests? (And, on a more quibbly note: Can you add the word "character" before "encoding" to the title, so that it's clear what kind of encoding is being referred to?) And here are the # Setup: *create* a BOM-less UTF-8 file.
'ö' | set-content -nonewline /tmp/$pid.txt
# Tests: Both should output $True
# Compare the raw bytes of the new file to the UTF-8 encoding of 'ö' (0xc3 0xb6)
# With the current alpha17, this would return $False, because Set-Content creates an
# ISO-8859-1 file.
$null -eq (Compare-Object (Get-Content -Encoding Byte -Raw /tmp/$pid.txt) (0xc3, 0xb6))
# See if the BOM-less UTF-8 file is *read* correctly.
'ö' -eq (Get-Content -Raw /tmp/$pid.txt) |
We have never used "character" before so it can confuse us even more. (?) |
Not that it will matter much in this instance, but just for the record and for future instances where the distinction may matter: We are discussing character encodings here. Encoding is a far more generic term, of which character encoding is just one instance. Given that the issues in this repo span all sorts of topics, giving sufficient context is preferable. P.S.: In light of the above, I would have preferred the title "Default Character Encoding" for the RFC. |
@mklement0 In the code we use "encoding". So let us defer the question to the discretion of the mantainers. |
Sounds good. It's perfectly understandable to shorten "character encoding" to "encoding" in a given, narrow context, where there's no risk of ambiguity. My only point is that in a larger context the added specificity can be helpful - both for searching topics by keywords and for quick comprehension. |
Now we don't have a full set of encoding tests (only for redirections). We need to create them during future Encoding RFC implementation (?).
In #3467 (discussion Issue #3248) we fix Default/OEM encoding behavior PowerShell Core on Windows (as in Windows PowerShell) but don't add tests (waiting the RFC). The simplest test (from @mklement0) is:
We need test for:
The text was updated successfully, but these errors were encountered: