Skip to content

Conversation

@wiitt
Copy link
Collaborator

@wiitt wiitt commented Mar 5, 2025

This PR solves #37.

There is an issue with handling special characters in MATLAB versions supposedly R2019a and older. As I understood according to a comment on mathworks, MATLAB changed default encoding from windows-1252 to UTF-8 in R2019b. Newer versions of MATLAB seem to handle older encoding, but not the other way around. So, I replaced a special character in progress bar class with an ASCII symbol which is similar in both encodings. But similar solution was not possible for util.extract_tree(). That is why this function is resaved with an older encoding.

Besides the commits, version requirements have been updated on wiki page.

I'm not sure that I have permissions to update information on File Exchange. It would be great to fix it as well.

@wiitt
Copy link
Collaborator Author

wiitt commented Mar 5, 2025

Hmm, this might be not true at all or just for Linux. I'll need to look at it a bit more.

Newer versions of MATLAB seem to handle older encoding

wiitt added 2 commits March 5, 2025 10:21
Decode them when function is called
Allows to avoid issues caused by MATLAB using different encodings
@wiitt wiitt force-pushed the issue-37-clarifying-version-compatibility branch from e292be2 to f597cac Compare March 5, 2025 18:25
@wiitt
Copy link
Collaborator Author

wiitt commented Mar 5, 2025

Instead of saving an m-file with an older encoding, replaced special characters with corresponding UTF-8 bytes sequences. When function is executed, bytes are decoded with explicitly specified encoding by MATLAB. It helps to mitigate different default encodings used by different versions of MATLAB.

Copy link

@KristenMeyerONC KristenMeyerONC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for adding the version info.

I took a look and the file exchange compatibility seems to be set when packaging a toolbox. The packaged toolbox is here: https://github.com/OceanNetworksCanada/api-matlab-client/tree/main/dist it looks like it is a couple of versions out of date.

In a separate issue can you create a new version of the toolbox package with correct version compatibility, (probably use the version of the next release in the toolbox name). Then work with @spencerwplovie to do a new release? The toolbox may need to be attached to the release itself. See "GitHub Releases" in: https://www.mathworks.com/matlabcentral/content/fx/about.html

@wiitt wiitt merged commit eb8f622 into main Mar 5, 2025
2 checks passed
@wiitt wiitt deleted the issue-37-clarifying-version-compatibility branch March 5, 2025 21:53
@wiitt wiitt linked an issue Mar 5, 2025 that may be closed by this pull request
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

Successfully merging this pull request may close these issues.

It is unclear what MATLAB versions are supported by the API client

3 participants