Reverse a string without using string.reverse

Title says it all :o

[lua]
function rev(str)
local t = {}
for i = 0, #str, 1 do
t[i + 1] = str:sub(#str - 1, #str - 1)
end
return table.concat(t, “”)
end
[/lua]

Why? :o

boredom.

#str will count the bytes in the string; this will run into problems with characters that are larger than 1 byte due to Lua using UTF-8 encoding.