php-spellchecker icon indicating copy to clipboard operation
php-spellchecker copied to clipboard

Process with command "aspell --encoding utf-8 -a --lang=en_US" has failed running with exit code 1 on Windows

Open AmilaPriyankara opened this issue 2 years ago • 2 comments

when I create execute of aspell its throw an exception

$spell = Aspell::create(); $response = $spell->check('mispell', ['en_US']); logger(print_r($response, true));

image

image

image

image

image

PHP 8: Window 10 Laravel 9 xampp

AmilaPriyankara avatar Jul 01 '22 14:07 AmilaPriyankara

Hello @AmilaPriyankara, thanks for you report.

I haven't tested the lib on windows to be honest, so I'll try to blindly debug it with you.

In tinker, instead of image Could you try var_dump(iterator_to_array($response)))

Also when testing the command line directly, could you try echo 'mispell' | aspell --encoding=utf-8 -a --lang=en_US as it's what is actually executed in the background.

Let me know the output for both please.

tigitz avatar Jul 02 '22 17:07 tigitz

Digging a little further, according to https://superuser.com/questions/1496150/configuring-aspell-to-support-utf-8-encoded-texts it seems like --encoding is only supported in aspell 0.60 which is not available on windows (your version is 0.50 which seems to be concording).

I'm unsure on how to circumvent the problem to support aspell usage for windows users right now. If you tried anything on your hand, let me know.

tigitz avatar Jul 02 '22 17:07 tigitz