Skip to content

base64string #22

Description

@he852100
#Conversion error when the input and output are encoded differently
$str=".d_'+♂¢£"
$in='Unicode'
$to='utf8'
$en=[Convert]::ToBase64String([System.Text.Encoding]::$in.GetBytes($str))
$de=[System.Text.Encoding]::$to.GetString([System.Convert]::FromBase64String($en))
$en;$de
$uri='https://github.com/stadub/PowershellScripts/issues/22'
$r=irm $uri|select-string -Pattern '(?<=gid=")[^"]+' -AllMatches
$r.matches.value
$r.matches.value|%{$_|ConvertFrom-Base64String}

The common encoding in the network is utf8.

Need to use utf8,Or join the conversion option。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions