{{ message }}

Instantly share code, notes, and snippets.

# Egor-Skriptunoff/utf8_filenames.lua

Last active Sep 10, 2020
UTF-8 filenames on Windows in pure Lua

### vadi2 commented Jul 12, 2019

 I've already fixed this https://github.com/Mudlet/Mudlet/pull/2756/files, like I said it matters whenever you have nil or no arguments to the C API - just thought I'd report it here as well :) there are a couple of other no-argument functions that get broken as well.

### Egor-Skriptunoff commented Jul 12, 2019

 @vadi2 - Thanks for bugreport. Indeed, io.lines(nil) raises an error on Lua 5.1 :-( I didn't understand your first post about this bug because I was confused by the following Lua 5.1 source:  static int io_lines (lua_State *L) { if (lua_isnoneornil(L, 1)) { /* no arguments? */ /* will iterate over default input */ This code looks as if the intention of Lua authors was to NOT distinguish between "no arguments" and "nil as the argument". Probably, it's just a bug in Lua 5.1 (it was fixed in Lua 5.2). It's sad that Lua team doesn't fix known bugs in Lua 5.1. BTW, os.execute, dofile and loadfile work pretty well with nil as argument ;-) Only io.lines` should be workarounded.

### vadi2 commented Jul 13, 2019

 It's not a bug in Lua 5.1 - it's how it works... :) glad we got it sorted. The fix is easy at least.