8000 Need a full set of encoding tests · Issue #3488 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content
Need a full set of encoding tests #3488
@iSazonov

Description

@iSazonov

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:

# Setup:
# Create a no-BOM UTF-8 file with the following literal content:
#   'ö' 
# which, when executed as a PS script, should echo 'ö' back, IF the script
# was correctly decoded from UTF-8 by PS.
# UTF-8 bytes: 0x27 (single quote), 0xc3 0xb6 (encoding of 'ö', U+00F6), 0x27 (single quote)
[byte[]] (0x27, 0xc3, 0xb6, 0x27) | Set-Content -Encoding Byte /tmp/$PID.ps1

# Test: See if the 'ö' is echoed back correctly.
#       Should return $True
'ö' -eq (& /tmp/$PID.ps1)

We need test for:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugWG-Quality-Testissues in a test or in test infrastructure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0