changing console codepage on windows breaks lua REPL

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

changing console codepage on windows breaks lua REPL

Marcus Mason
when I use  chcp 65001 to change codepage to utf8 the lua repl cannot handle utf8 input:
> [[€]]
>>
Does anyone know how to fix this?
Reply | Threaded
Open this post in threaded view
|

Re: changing console codepage on windows breaks lua REPL

Gabriel Bertilson
I had this problem when I was running Windows as well, and it annoyed
me to no end. I mostly use Linux now, but I think that lua-u8w
(https://github.com/nathancorvussolis/lua-u8w) at least allowed me to
open files with non-ASCII characters in their paths, so it's worth a
try if you can figure out how to compile it. There are Visual Studio
files in the repository, and I somehow managed to compile in Visual
Studio, even though I don't really understand how the program works.

— Gabriel

On Wed, Oct 23, 2019 at 1:07 PM Marcus Mason <[hidden email]> wrote:
>
> when I use  chcp 65001 to change codepage to utf8 the lua repl cannot handle utf8 input:
> > [[€]]
> >>
> Does anyone know how to fix this?

Reply | Threaded
Open this post in threaded view
|

Re: changing console codepage on windows breaks lua REPL

Scott Morgan
In reply to this post by Marcus Mason
On 23/10/2019 19:06, Marcus Mason wrote:
> when I use  chcp 65001 to change codepage to utf8 the lua repl cannot
> handle utf8 input:
>> [[€]]
>>>
> Does anyone know how to fix this?


I don't think MS has officially fixed their broken UTF8 support for the
command prompt and std C functions yet.

Scott

Reply | Threaded
Open this post in threaded view
|

Re: changing console codepage on windows breaks lua REPL

Marcus Mason
This isn't an issue with microsoft, if I run lua in WSL (same terminal) it can handle UTF8 input correctly, so my input is correctly handed to the linux subsystem. The issue is with how lua reads characters on windows, I think using fgets is not robust enough.

On Thu, Oct 24, 2019 at 1:36 AM Scott Morgan <[hidden email]> wrote:
On 23/10/2019 19:06, Marcus Mason wrote:
> when I use  chcp 65001 to change codepage to utf8 the lua repl cannot
> handle utf8 input:
>> [[€]]
>>>
> Does anyone know how to fix this?


I don't think MS has officially fixed their broken UTF8 support for the
command prompt and std C functions yet.

Scott