8000 Support decoding multi-byte characters in Python script by jot-jt · Pull Request #2344 · colmap/colmap · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support decoding multi-byte characters in Python script #2344

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

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

jot-jt
Copy link
Contributor
@jot-jt jot-jt commented Jan 11, 2024

This fixes an issue where read_images_binary() throws an exception when decoding image names with multi-byte characters.

UTF-8 encodes characters using one to four bytes, so decoding byte-by-byte sometimes won't work if a character is encoded with more than one byte. For instance, if a character is encoded using three bytes, all three bytes need to be passed into .decode("utf-8") for it to return the proper character. This pull request decodes the entire image name at once to avoid this issue.

@ahojnnes ahojnnes merged commit 5d4535a into colmap:main Jan 11, 2024
@ahojnnes
Copy link
Contributor

Thanks!

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.

2 participants
0