Sorry, I just saw the above pscmd3 code updated.
I added parameter 1 with the new version of pscmd3 but still garbled?
Macro Macro14
PsCmd3 _s "" str's 1 ;;Output: Unicode characters are garbled
PsCmd3 _s "" str's ;;Output: Unicode characters are not garbled
Why?
I just tested the English version of the system, the parameters have no effect, will produce garbled, please see the following GIF demo
I added parameter 1 with the new version of pscmd3 but still garbled?
Macro Macro14
;Under the Chinese operating system
_s=
;Add-Type -AssemblyName System.Web;
;$url='https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic';
;$pic='C:\1.png';
;$imagedata=[Web.HttpUtility]::UrlEncode([Convert]::ToBase64String([IO.File]::ReadAllBytes($pic)));
;$poststr=@(
;;;;;'access_token=24.b305c9822131e65eda05e29c157dd719.2592000.1559103982.282335-16139329',
;;;;;$('image='+$imagedata),
;;;;;'language_type=CHN_ENG',
;;;;;'detect_direction=false',
;;;;;'detect_language=false',
;;;;;'probability=false'
;) -join '&';
;$web=New-Object System.Net.WebClient;
;$web.Headers.Add('Content-Type', 'application/x-www-form-urlencoded');
;[byte[]]$postdata=[Text.Encoding]::UTF8.GetBytes($poststr);
;[byte[]]$responsedata=$web.UploadData($url, 'POST', $postdata);
;[Text.Encoding]::UTF8.GetString($responsedata);
PsCmd3 _s "" str's 1 ;;Output: Unicode characters are garbled
mes s
PsCmd3 _s "" str's 1 ;;Output: Unicode characters are garbled
PsCmd3 _s "" str's ;;Output: Unicode characters are not garbled
Why?
I just tested the English version of the system, the parameters have no effect, will produce garbled, please see the following GIF demo