I am trying to use a webservice where my password contains a £ character but I get an error like:
Caught "std::exception" Exception message is:
Invalid character code sequence detected.
This error is unusual as it doesn't provide a stack trace When I remove the £ symbol I do not get the error.
You can recreate the error like this (you don't need a valid web service).
% Normal
options = weboptions('Username', 'someusername', 'Password', 'letmein', 'MediaType', 'application/json'); webwrite('http://example.com', struct(), options); % Add £ to password and get Error
options = weboptions('Username', 'someusername', 'Password', 'letmein£', 'MediaType', 'application/json'); webwrite('http://example.com', struct(), options);
I currently work around the issue by changing my password to one that does work but this is inconvenient and may not always be possible.
Best Answer