Skip to content
/ golua Public

[MOVED TO GITLAB] Package unicode adds unicode support to some functions in golua's string library.

Notifications You must be signed in to change notification settings

Ambrevar/golua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Golua Unicode Support

This extension to Arzilli's Golua adds Unicode support to all functions from the Lua string library.

Lua patterns are replaced by Go regexps. This breaks compatibility with Lua, but Unicode support breaks it anyways and Go regexps are more powerful.

Example

package main

import (
	"github.com/ambrevar/golua/unicode"
	"github.com/aarzilli/golua/lua"
)

func main() {
	L := lua.NewState()
	defer L.Close()
	L.OpenLibs()
	unicode.GoLuaReplaceFuncs(L)

	L.DoString(`print(string.len("résumé"))`)
	L.DoString(`print(string.upper("résumé"))`)
	L.DoString(`print(string.gsub("résumé", "\\pL", "[$0]"))`)
}

About

[MOVED TO GITLAB] Package unicode adds unicode support to some functions in golua's string library.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages