@@ -3042,7 +3042,7 @@ def preset_catalog_add(
30423042 # Load existing config
30433043 if config_path .exists ():
30443044 try :
3045- config = yaml .safe_load (config_path .read_text ()) or {}
3045+ config = yaml .safe_load (config_path .read_text (encoding = "utf-8" )) or {}
30463046 except Exception as e :
30473047 console .print (f"[red]Error:[/red] Failed to read { config_path } : { e } " )
30483048 raise typer .Exit (1 )
@@ -3070,7 +3070,7 @@ def preset_catalog_add(
30703070 })
30713071
30723072 config ["catalogs" ] = catalogs
3073- config_path .write_text (yaml .dump (config , default_flow_style = False , sort_keys = False ) )
3073+ config_path .write_text (yaml .dump (config , default_flow_style = False , sort_keys = False , allow_unicode = True ), encoding = "utf-8" )
30743074
30753075 install_label = "install allowed" if install_allowed else "discovery only"
30763076 console .print (f"\n [green]✓[/green] Added catalog '[bold]{ name } [/bold]' ({ install_label } )" )
@@ -3098,7 +3098,7 @@ def preset_catalog_remove(
30983098 raise typer .Exit (1 )
30993099
31003100 try :
3101- config = yaml .safe_load (config_path .read_text ()) or {}
3101+ config = yaml .safe_load (config_path .read_text (encoding = "utf-8" )) or {}
31023102 except Exception :
31033103 console .print ("[red]Error:[/red] Failed to read preset catalog config." )
31043104 raise typer .Exit (1 )
@@ -3115,7 +3115,7 @@ def preset_catalog_remove(
31153115 raise typer .Exit (1 )
31163116
31173117 config ["catalogs" ] = catalogs
3118- config_path .write_text (yaml .dump (config , default_flow_style = False , sort_keys = False ) )
3118+ config_path .write_text (yaml .dump (config , default_flow_style = False , sort_keys = False , allow_unicode = True ), encoding = "utf-8" )
31193119
31203120 console .print (f"[green]✓[/green] Removed catalog '{ name } '" )
31213121 if not catalogs :
@@ -3384,7 +3384,7 @@ def catalog_add(
33843384 # Load existing config
33853385 if config_path .exists ():
33863386 try :
3387- config = yaml .safe_load (config_path .read_text ()) or {}
3387+ config = yaml .safe_load (config_path .read_text (encoding = "utf-8" )) or {}
33883388 except Exception as e :
33893389 console .print (f"[red]Error:[/red] Failed to read { config_path } : { e } " )
33903390 raise typer .Exit (1 )
@@ -3412,7 +3412,7 @@ def catalog_add(
34123412 })
34133413
34143414 config ["catalogs" ] = catalogs
3415- config_path .write_text (yaml .dump (config , default_flow_style = False , sort_keys = False ) )
3415+ config_path .write_text (yaml .dump (config , default_flow_style = False , sort_keys = False , allow_unicode = True ), encoding = "utf-8" )
34163416
34173417 install_label = "install allowed" if install_allowed else "discovery only"
34183418 console .print (f"\n [green]✓[/green] Added catalog '[bold]{ name } [/bold]' ({ install_label } )" )
@@ -3440,7 +3440,7 @@ def catalog_remove(
34403440 raise typer .Exit (1 )
34413441
34423442 try :
3443- config = yaml .safe_load (config_path .read_text ()) or {}
3443+ config = yaml .safe_load (config_path .read_text (encoding = "utf-8" )) or {}
34443444 except Exception :
34453445 console .print ("[red]Error:[/red] Failed to read catalog config." )
34463446 raise typer .Exit (1 )
@@ -3457,7 +3457,7 @@ def catalog_remove(
34573457 raise typer .Exit (1 )
34583458
34593459 config ["catalogs" ] = catalogs
3460- config_path .write_text (yaml .dump (config , default_flow_style = False , sort_keys = False ) )
3460+ config_path .write_text (yaml .dump (config , default_flow_style = False , sort_keys = False , allow_unicode = True ), encoding = "utf-8" )
34613461
34623462 console .print (f"[green]✓[/green] Removed catalog '{ name } '" )
34633463 if not catalogs :
0 commit comments