@@ -41,7 +41,7 @@ def list_table_names(db_path: str | Path) -> list[str]:
4141 subprocess .check_output ( # noqa: S603
4242 ["mdb-tables" , "--single-column" , _path_to_cmd_str (db_path )], # noqa: S607
4343 )
44- .decode ()
44+ .decode (locale . getpreferredencoding () )
4545 .replace ("\r \n " , "\n " )
4646 .strip ()
4747 )
@@ -106,12 +106,10 @@ def _extract_data_type_definitions(defs_str: str) -> dict[str, str]:
106106def _read_table_mdb_schema (
107107 db_path : str | Path ,
108108 table_name : str ,
109- encoding : str = "utf-8" ,
110109) -> dict [str , str ]:
111110 """Read the schema of a given database into a dictionary of the mdb-schema output.
112111
113112 :param db_path: The MS Access database file.
114- :param encoding: The schema encoding.
115113 :return: a dictionary of `{column_name: access_data_type}`
116114 """
117115 cmd = [
@@ -135,7 +133,7 @@ def _read_table_mdb_schema(
135133 raise ValueError (msg ) from e
136134 raise
137135
138- cmd_output = cmd_output .decode (encoding )
136+ cmd_output = cmd_output .decode (locale . getpreferredencoding () )
139137 lines = cmd_output .splitlines ()
140138 schema_ddl = "\n " .join (line for line in lines if line and not line .startswith ("-" ))
141139
@@ -203,8 +201,7 @@ def read_table(
203201 Otherwise, raise an error on unhandled SQL data types.
204202 :return: a `pl.DataFrame`
205203 """
206- schema_encoding = "utf-8"
207- mdb_schema = _read_table_mdb_schema (db_path , table_name , schema_encoding )
204+ mdb_schema = _read_table_mdb_schema (db_path , table_name )
208205 pl_schema_target = _convert_mdb_schema_to_polars_schema (
209206 mdb_schema ,
210207 implicit_string = implicit_string ,
0 commit comments