Skip to content

Bug report: Cannot load .obj file when path contains Korean characters #7336

@easternfieldc

Description

@easternfieldc

Checklist

Describe the issue

When attempting to load an ASCII .obj file using open3d.io.read_triangle_mesh() in a Windows environment, the function fails with a UTF-8 decoding error if the file path contains Korean (Hangul) characters. However, the same file saved as ASCII .ply loads successfully under identical conditions.

Steps to reproduce the bug

  1. Save an ASCII .obj file with UTF-8 encoding.
  2. Place the file in a directory with Korean characters in the path, e.g., C:/Users/사용자/샘플/sample.obj
  3. Run the following code:
import open3d as o3d
mesh = o3d.io.read_triangle_mesh("C:/Users/사용자/샘플/sample.obj")
  1. Observe the error:
'utf-8' codec can't decode byte 0xbb in position XX: invalid start byte
  1. Save the same mesh as .ply in ASCII format and load it from the same path:
mesh = o3d.io.read_triangle_mesh("C:/Users/사용자/샘플/sample.ply")
  1. This works without error.

Error message

'utf-8' codec can't decode byte 0xbb in position XX: invalid start byte

Expected behavior

Both .obj and .ply files should load successfully from paths containing non-ASCII characters, assuming the files themselves are properly encoded.

Actual Behavior

Only .ply files load successfully. .obj files fail with a UTF-8 decoding error.

Open3D, Python and System information

OS: Windows 10/11 (Korean locale)
Open3D version: 0.19.0
Python version: 3.10
File encoding: UTF-8 (confirmed)
File format: ASCII .obj and .ply

Additional information

  • The .obj file has been verified to be UTF-8 encoded.
  • The issue seems to be related to how Open3D parses .obj files internally, possibly involving texture or material references.
  • This issue does not occur when the path contains only ASCII characters.

Suggested Fix

  • Ensure that Open3D’s .obj parser properly handles Unicode file paths and internal references.
  • Consider using wide-character APIs or Python’s Path objects with proper encoding handling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugNot a build issue, this is likely a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions