ksbawpn
ksbawpn

Reputation: 322

Excel VBA on Mac german special characters not encoded correctly (ÄÜÖ)

I have an Excel VBA Script that I originally wrote for Windows (where it works fine) and now had to port to Mac OS. I don't think that it matters but the script is calling cURL to get a JSON Response from a web API which is then parsed, edited and inserted into the spreadsheet.

Some of the fields in the parsed JSON contain special characters like Ä, Ü, Ö (German characters). The script can handle these just fine on Windows but on Mac instead of ÖÜÄ I get other symbols. This breaks the tool as it depends on some vlookup-functions where the values are written by hand (with the correct symbols).

I tried lots of googling but was not able to find anything.

One thing that might be interesting is that the code itself changes on Mac as well! I have some statements printed to the console and even the hardcoded strings that contain a special character are broken as soon as I open the script on a Mac.

Upvotes: 2

Views: 377

Answers (1)

sysmod
sysmod

Reputation: 459

The question is for Mac VBA. This is a pain. The only solution I have is to send the curl output to a file, then open that file with workbooks.opentext and Origin:=65001 and all the response is in cell A1, correctly encoded. I have asked my own question on that, to see if any one has a more recent answer. How to read UTF8 data output from cURL in popen/fread in VBA on Mac?

Upvotes: 1

Related Questions