<div dir="ltr">Python problem. Output to terminal is not the same as output to pipe.<div><br></div><div>Git Bash on Windows 10.  Also under PowerShell. Under Windows Terminal.  Python 3.10.2.</div><div><br></div><div>I believe if I remove the pi Unicode character it works. JSON attached.</div><div><br></div><div>Code is here at this URL:</div><div><br></div><div><a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/python/x3djsonld.py">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/python/x3djsonld.py</a><br></div><div><br></div><div>This is an encoding issue AFAIK.  Probably we've handled it before.</div><div><br></div><div>See below:</div><div>$ find /c/x3d-code/<a href="http://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter02GeometryPrimitives/">www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter02GeometryPrimitives/</a> -name TextSpecialCharacters.json| xargs python3 x3djsonld.py<div>==================================================<br>'''<br>x3d.py package 4.0.64.1 loaded, have fun with X3D Graphics!<br>'''<br>from x3d import *<br>print(<br>X3D(profile="Immersive", version="3.3",<br>head=head(),<br>Scene=Scene(children=[<br>WorldInfo(title="TextSpecialCharacters.x3d"),<br>Background(skyColor=[(1,1,1)]),<br>Viewpoint(description="Default View", position=((0,0,15))),<br>Shape(<br>geometry=<br>Text(DEF="DefaultText", string=["Character entity substitutions:","empty string \"\" skips a line:","","apostrophe ' is &apos;","ampersand & is &","quote mark \" is &quot;","backslash \\ is X3D escape character","double backslash \\\\ is X3D backslash \\ character","Pi Π is &#928; XML character entity"],<br>fontStyle=<br>FontStyle(DEF="CenteredFontStyle", justify=["MIDDLE","MIDDLE"])),<br>appearance=<br>Appearance(<br>material=<br>Material(DEF="DefaultMaterial", diffuseColor=((0.2,0.2,0.2)))))]))<br>.XML())<br>=====================================================</div><div>$ find /c/x3d-code/<a href="http://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter02GeometryPrimitives/">www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter02GeometryPrimitives/</a> -name TextSpecialCharacters.json| xargs python3 x3djsonld.py | cat</div><div>=====================================================<br>'''<br>x3d.py package 4.0.64.1 loaded, have fun with X3D Graphics!<br>Traceback (most recent call last):<br>  File "x3djsonld.py", line 265, in <module><br>'''<br>from x3d import *<br>print(    print(parseObject("X3D", data, 0))<br>  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\encodings\cp1252.py", line 19, in encode<br>    return codecs.charmap_encode(input,self.errors,encoding_table)[0]<br>UnicodeEncodeError: 'charmap' codec can't encode character '\u03a0' in position 513: character maps to <undefined><br></div></div><div><br></div><div><br></div><div>Tried under PowerShell for Microsoft people. I don't see why there's so much repetition in errors.</div><div>=====================================================</div><div>PS C:\Users\john\X3DJSONLD\src\main\python> python .\x3djsonld.py ..\data\TextSpecialCharacters.json| Get-Content</div><div>======================================================<br>Traceback (most recent call last):<br>  File "C:\Users\john\X3DJSONLD\src\main\python\x3djsonld.py", line 265, in <module><br>    print(parseObject("X3D", data, 0))<br>  File "C:\Python310\lib\encodings\cp1252.py", line 19, in encode<br>    return codecs.charmap_encode(input,self.errors,encoding_table)[0]<br>UnicodeEncodeError: 'charmap' codec can't encode character '\u03a0' in position 470: character maps to <undefined><br>Get-Content : The input object cannot be bound to any parameters for the command either because the<br>command does not take pipeline input or the input and its properties do not match any of the<br>parameters that take pipeline input.<br>At line:1 char:59<br>+ python .\x3djsonld.py ..\data\TextSpecialCharacters.json| Get-Content<br>+                                                           ~~~~~~~~~~~<br>    + CategoryInfo          : InvalidArgument: (''':PSObject) [Get-Content], ParameterBindingExcepti<br>   on<br>    + FullyQualifiedErrorId : InputObjectNotBound,Microsoft.PowerShell.Commands.GetContentCommand<br><br>Get-Content : The input object cannot be bound to any parameters for the command either because the<br>command does not take pipeline input or the input and its properties do not match any of the<br>parameters that take pipeline input.<br>At line:1 char:59<br>+ python .\x3djsonld.py ..\data\TextSpecialCharacters.json| Get-Content<br>+                                                           ~~~~~~~~~~~<br>    + CategoryInfo          : InvalidArgument: (x3d.py package ...h X3D Graphics!:PSObject) [Get-Con<br>   tent], ParameterBindingException<br>    + FullyQualifiedErrorId : InputObjectNotBound,Microsoft.PowerShell.Commands.GetContentCommand<br><br>Get-Content : The input object cannot be bound to any parameters for the command either because the<br>command does not take pipeline input or the input and its properties do not match any of the<br>parameters that take pipeline input.<br>At line:1 char:59<br>+ python .\x3djsonld.py ..\data\TextSpecialCharacters.json| Get-Content<br>+                                                           ~~~~~~~~~~~<br>    + CategoryInfo          : InvalidArgument: (''':PSObject) [Get-Content], ParameterBindingExcepti<br>   on<br>    + FullyQualifiedErrorId : InputObjectNotBound,Microsoft.PowerShell.Commands.GetContentCommand<br><br>Get-Content : The input object cannot be bound to any parameters for the command either because the<br>command does not take pipeline input or the input and its properties do not match any of the<br>parameters that take pipeline input.<br>At line:1 char:59<br>+ python .\x3djsonld.py ..\data\TextSpecialCharacters.json| Get-Content<br>+                                                           ~~~~~~~~~~~<br>    + CategoryInfo          : InvalidArgument: (from x3d import *:PSObject) [Get-Content], Parameter<br>   BindingException<br>    + FullyQualifiedErrorId : InputObjectNotBound,Microsoft.PowerShell.Commands.GetContentCommand<br><br>Get-Content : The input object cannot be bound to any parameters for the command either because the<br>command does not take pipeline input or the input and its properties do not match any of the<br>parameters that take pipeline input.<br>At line:1 char:59<br>+ python .\x3djsonld.py ..\data\TextSpecialCharacters.json| Get-Content<br>+                                                           ~~~~~~~~~~~<br>    + CategoryInfo          : InvalidArgument: (print(:PSObject) [Get-Content], ParameterBindingExce<br>   ption<br>    + FullyQualifiedErrorId : InputObjectNotBound,Microsoft.PowerShell.Commands.GetContentCommand<br></div></div>