Skip to content
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

base64string #22

Open
he852100 opened this issue Dec 7, 2019 · 0 comments
Open

base64string #22

he852100 opened this issue Dec 7, 2019 · 0 comments
Assignees
Labels

Comments

@he852100
Copy link

he852100 commented Dec 7, 2019

#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。

@stadub stadub self-assigned this Aug 30, 2020
@stadub stadub added the bug label Aug 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants