Jump to content

Which characters CANNOT be entered in llTextbox?


jak Scribe
 Share

You are about to reply to a thread that has been inactive for 498 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I am using Linkset to store my data and I need a separater inside the Linkset-Key to separate a Group name from a Texture name. ie: "Animations<separator>Texturename".

The HUD-User can enter thier own Groupnames using llTextbox, therefore I need a separater that cannot be entered as part of the entered text.

 

Any ideas out there?

Link to comment
Share on other sites

As far as  know, they can enter anything they want. If it were me, I'd use a 'zero-width space' as the separator. https://en.wikipedia.org/wiki/Zero-width_space

ETA: Apparently, the forum software does not like ZWSP's. Now that we have llChar, you could just use llChar(0x200B);

Edited by Quistess Alpha
Link to comment
Share on other sites

Function calls are not allowed in the global section, only in events or functions.

You have to do this instead:

string separator;

default {
  state_entry() {
    separator = llChar(0x200B);
  }
}

Or alternatively, you could copy that character from some tool like https://unicode-table.com/en/200B/, and just paste it as a string literal in the global section:

string separator = "";

(yes, that actually contains the character, but since it's a zero-width space it's invisible)

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
On 2/12/2023 at 1:08 AM, jak Scribe said:

I am using Linkset to store my data and I need a separater inside the Linkset-Key to separate a Group name from a Texture name. ie: "Animations<separator>Texturename".

The HUD-User can enter thier own Groupnames using llTextbox, therefore I need a separater that cannot be entered as part of the entered text.

 

Any ideas out there?

Are the "Animations" and "Texturename" parts referring to names of items in inventory?

Then you can just use any character not allowed in an inventory names, such as "\n".

  • Like 1
Link to comment
Share on other sites

The Texturename is an item name in the Inventory.

My problem is more with the "Animations".  That is just a Groupname that a user can decide on when entering textures, and it is entered in a Textbox, meaning they could use any characters they wanted.

I could of course check for a certain character and if it is there, ask the user to type in another Groupname without this character, but I wanted to keep it as user friendly and simple as possible.

Link to comment
Share on other sites

8 hours ago, jak Scribe said:

The Texturename is an item name in the Inventory.

My problem is more with the "Animations".  That is just a Groupname that a user can decide on when entering textures, and it is entered in a Textbox, meaning they could use any characters they wanted.

I could of course check for a certain character and if it is there, ask the user to type in another Groupname without this character, but I wanted to keep it as user friendly and simple as possible.

Ah, makes sense.

To the best of my knowledge, U+0009 (HT = Horizontal Tab) character cannot be typed into an llTextBox (pressing the Tab key will instead move the focus to the Submit button), and U+0009 has been tested to be safe according to BUG-233015.

Unfortunately, "\t" gets converted to "    " (four spaces) instead of U+0009, so you're not really saving much effort with U+0009 (still need to use save llChar(9) to a variable -- use local variable when needed!)

(Though you do save 1 byte in LSD as U+0009 uses 1 byte in UTF-8 while U+200B uses 2 bytes. Might or might not be significant for your use case.)

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 498 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...