Change the strategy for the U+FFFD separator handling.

Use a global variable instead. In SL, the optimizer does the replacement automatically, therefore no memory penalty is incurred. In OpenSim, the variable is assigned at run time with llUnescapeURL. The OpenSim separator is also changed from U+001F to U+007F, because most control characters under U+0020 cause problems with exporting when present in script memory.

Fixes #41.
This commit is contained in:
Sei Lisa 2017-09-09 10:33:28 +02:00 committed by Sei-Lisa
parent 8bd8b19e2f
commit d23699fbe6
5 changed files with 22 additions and 18 deletions

View file

@ -39,6 +39,7 @@ integer listen_handle;
integer number_per_page = 9;
integer menu_pages;
string last_text;
string SEP = "<22>"; // OSS::string SEP;
integer pass_security(key id)
{
@ -310,6 +311,7 @@ default
{
remove_script("Use only one copy of this script!");
}
// OSS::SEP = llUnescapeURL("%7F");
check_avsit();
notecard_key = llGetInventoryKey(notecard_name);
Out(0, "Loading...");
@ -375,7 +377,7 @@ default
mindex_test = llListFindList(MENU_LIST, ["B:" + msg]);
if (mindex_test != -1)
{
list button_data = llParseStringKeepNulls(llList2String(DATA_LIST, mindex_test), ["<22>"], []);
list button_data = llParseStringKeepNulls(llList2String(DATA_LIST, mindex_test), [SEP], []);
if (llList2String(button_data, 1) != "")
{
msg = llList2String(button_data, 1);
@ -467,7 +469,7 @@ default
}
else if (llList2String(change_me, 0) == "B")
{
list l = [llList2String(change_me, 1), strReplace(strReplace(llList2String(DATA_LIST, i), "90200", ""), "<22>", "|")];
list l = [llList2String(change_me, 1), strReplace(strReplace(llList2String(DATA_LIST, i), "90200", ""), SEP, "|")];
if (llList2String(l, 1) == "")
{
l = llList2List(l, 0, 0);
@ -594,7 +596,7 @@ default
string part1 = llList2String(parts, 1);
if (llGetListLength(parts) > 1)
{
part1 = llStringTrim(llDumpList2String(llList2List(parts, 1, -1), "<22>"), STRING_TRIM);
part1 = llStringTrim(llDumpList2String(llList2List(parts, 1, -1), SEP), STRING_TRIM);
}
if (command == "TEXT")
{