pgrx icon indicating copy to clipboard operation
pgrx copied to clipboard

Panic in non-utf-8 code pages in Windows

Open if0ne opened this issue 8 months ago • 3 comments

All lines of code String::from_utf8(output.stdout).unwrap() in pgrx-pg-config cause a panic if Windows uses a non utf-8 code page, e.g. Cyrillic Windows uses 866.

Possible solutions:

  1. Use from_utf8_lossy
  2. Add additional step in Getting Started for Windows: Using UTF-8 in the Windows Terminal

if0ne avatar May 13 '25 09:05 if0ne

I have same problem. In windows 11 enviroment. How can I solve this?

456258zaq avatar Jun 10 '25 23:06 456258zaq

I have same problem. In windows 11 enviroment. How can I solve this?

I'll make PR. For now, you can check the Beta: Use Unicode UTF-8 for worldwide language support option. checkbox in Windows settings.

if0ne avatar Jun 11 '25 07:06 if0ne

hi @if0ne

I can not use Beta use unicode option. because character is broken by this option(my old program). I solve this from first comment to use function of from_utf8_lossy.

thanks your comment

456258zaq avatar Jun 11 '25 23:06 456258zaq