File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -899,7 +899,7 @@ def from_string(
899899 ``"D*+ -> (D0 -> K+ pi-) pi+"``.
900900 grammar_file : str or Path, optional
901901 Path to a custom Lark grammar file for descriptor parsing.
902- If not provided, the default grammar is used .
902+ The default grammar file is ``decaylanguage/data/descriptor.lark`` .
903903
904904 Returns
905905 -------
@@ -922,12 +922,14 @@ def from_string(
922922 # Load the grammar
923923 if grammar_file is None :
924924 # Use the default descriptor grammar from the data package
925- grammar = data .basepath .joinpath ("descriptor.lark" ).read_text ()
925+ grammar = data .basepath .joinpath ("descriptor.lark" ).read_text (
926+ encoding = "utf-8"
927+ )
926928 else :
927929 # Use custom grammar file
928930 if isinstance (grammar_file , str ):
929931 grammar_file = Path (grammar_file )
930- grammar = grammar_file .read_text ()
932+ grammar = grammar_file .read_text (encoding = "utf-8" )
931933
932934 # Parse the descriptor
933935 try :
You can’t perform that action at this time.
0 commit comments