peachpiecompiler / peachpie

PeachPie - the PHP compiler and runtime for .NET and .NET Core
https://www.peachpie.io
Apache License 2.0
2.31k stars 201 forks source link

Special characters cannot be recognized #1127

Closed xiangyi-wang closed 7 months ago

xiangyi-wang commented 7 months ago

I'm not sure if this is a compiler issue or a VS setup issue this is the symfony\polyfill-iconv\Resources\charset\from.*.php image image

jakubmisek commented 7 months ago

Thank you for reporting the issue.

The files are probably in a local encoding(s), not UTF. The compiler (parser) tries to detect the encoding but unsuccessfully; so it results in the wrong tokens.

I would recommend converting the files to UTF-8 (with BOM), or specifying the CodePage property.

xiangyi-wang commented 7 months ago

Thank you for reporting the issue.

The files are probably in a local encoding(s), not UTF. The compiler (parser) tries to detect the encoding but unsuccessfully; so it results in the wrong tokens.

I would recommend converting the files to UTF-8 (with BOM), or specifying the CodePage property.

Thank you! It's my foolish. I have solved it.