Skip to content

Need help for Python error: wrong char code outside of range [0..$10ffff] #85

@Alexey-T

Description

@Alexey-T

I use this fork
https://github.com/alexey-t/python-for-lazarus
In the folder demo_lazarus I have a demo, which shows the problem. I cannot test this on Delphi (no Delphi here, I use Linux Ubuntu 18.x x64, Python 3.7).

  • i run the demo
  • demo provides Py module "demo" with function "s1". So i test it.
  • in demo console, i enter
import demo
=demo.s1()

and have this error.
Screenshot from 2019-10-10 13-04-15

This is from Unicode string with high values:

function Py_s1(Self, Args : PPyObject): PPyObject; cdecl;
const
  S0: string = 'begin.𠏽𠏽𠏽𠏽𠏽.end';
begin
  with GetPythonEngine do
    Result:= PyString_FromString(PChar(S0));
end;

Can you repro this on Delphi?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions