×

To be able to write in the forum you need to authenticate. Meanwhile it's read-only.

Re: UTF8 sandbox docs

UTF8 sandbox docs
June 03, 2016 04:41PM
The doxygen sections all for the UTF8xxxx functions say returns uppercase for all the functions including toLower. I suspect a copy/paste error. Also, is there now a UTF8Len function?
Re: UTF8 sandbox docs
June 03, 2016 08:27PM
I returns lower case if I am not mistaken. It is easy to test for you
There is no more UTF8 api functions. Use function like i have in the alphabetchecker in the other post
Re: UTF8 sandbox docs
June 03, 2016 11:22PM
Are the UTF8 functions no longer there at all? Deprecated? If gone, shouldn't they be removed from the docs?

I am using those from your alphabet checker but had a problem wit upper casing because the utf8_data array is not defined anywhere. I ducked the issue by assuming the first character of any country, region or county is always already uppercase. Should there be a json blob for the data array maybe?
Re: UTF8 sandbox docs
June 03, 2016 11:31PM
the utf8 functions
PGC_UTF8ToUpper
PGC_UTF8ToLower
PGC_UTF8SubStr
as described in
http://project-gc.com/doxygen/lua-sandbox/classPGC__LUA__Sandbox.html#a3eaa1bd6f9634bd7755973d9426153d5
are still there
I meant that there are no more utf8 function then the one listed in the doxygen page linked above
There is no need ut reimplement the function in pure lua.
Re: UTF8 sandbox docs
June 03, 2016 11:41PM
So PGC_UTF8Len never got implemented? I thought I found a thread on the boards suggesting it was going to be. Thanks
Re: UTF8 sandbox docs
June 03, 2016 11:45PM
I down know try to use it and if it works it exist. But the pure lua utf8 code i used included a len function if I am not mistaken
Re: UTF8 sandbox docs
June 04, 2016 12:00AM
Will test it once I get approval to write/test scripts. Sigh.

I think your utf8_toupper function depends on an array that is defined by a cimport in the original code you derived your version from but the array is not defined since it is never set up.

See this code which sets it up in the utf8.lua module

--[==[
-- UTF8 functions
-- Author: Andrew Stacey
-- Website: http://www.math.ntnu.no/~stacey/HowDidIDoThat/iPad/Codea.html
-- Licence: CC0 http://wiki.creativecommons.org/CC0
--[[
This file provides some basic functionality for dealing with utf8
strings. The basic lua string operations act on a byte-by-byte basis
and these have to be modified to work on a utf8-character basis.
--]]
local UTF8 = class()
cimport "BinDecHex"
local utf8_upper, utf8_lower = unpack(cimport "utf8Case",nil)
Re: UTF8 sandbox docs
June 04, 2016 01:20AM
Yes that function wont work. I have use the function in the api because the PHP function that is used have conversion tables
I copied all code from the web page and only changed the functions that i have used.
You have change some capitalization on functions because of how the PHPLua sandbox work
lite unpack to Unpack
see: http://project-gc.com/forum/read?7,16
Sorry, only registered users may post in this forum.

Click here to login