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

On Mac Japanese, the Json double quote Escape backslash \ (0x5c) is converted to 0x80 #474

Open
yaju opened this issue May 4, 2022 · 1 comment

Comments

@yaju
Copy link

yaju commented May 4, 2022

I'm using a Japanese version of Excel 2019 on a Mac
The following JSON will result in an error.
'{"using":"css selector","value":"[name=\"q\"]","sessionId":"17b3467186550c38a92aeee9f809712e"}'

After investigating the cause with the "WireShark" application
image

backslash \ (0x5c) is converted to 0x80

MacJapanese is a character code that Apple has independently extended Shift_JIS.
0x80 …… U+5C reverse solidus (= backslash)

popen api is using MacJapanse.Is there a workaround for this?

@yaju
Copy link
Author

yaju commented May 8, 2022

I found a solution.

For Japanese version, replace backslash with yen mark.

WebClient.bas

Public Function PrepareCurlRequest(Request As WebRequest) As String

    Dim body As String: body = Request.body
    If Application.LanguageSettings.LanguageID(msoLanguageIDInstall) = 1041 Then
        body = Replace(body, "\", "¥")
    End If
    web_Curl = web_Curl & " -d '" & body & "'"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant