string
Let an agent handle strings by encoding, length, operations, validation and security.
Research draft, second pass
A second pass drafted this model: the structure a model of this thing needs, and what is known about it in the world. The line under this one says how the second half was obtained - researched against sources, or recalled without web access, in which case nothing here was read anywhere and every claim is a lead to verify. Unreviewed either way.
written by Claude from model knowledge without web access - no source was read, every claim is a lead to verify
Researched by: Claude
Purpose and description
Let an agent handle strings by encoding, length, operations, validation and security.
In computing and formal languages, a finite sequence of characters or symbols, such as text, identifiers, codes and status messages, handled as a data type with an encoding and length.
What it is for: Storing and processing text and symbolic data.
It can be compare and search strings; validate formats; normalise and encode text; escape strings safely.
Distinguishing features
Ordered sequence of characters
Has encoding and length
Immutable in many languages
Unsafe handling causes injection flaws
What it looks like
Text between quotes in code, or fields in data.
How it is recognised
Quoted text in code
Encodings such as UTF-8
Identifiers and codes stored as strings
Related models
is a kind of - category
is encoded in - encoding
is processed by - operations
is confused with - another sense
In practice
Families and kinds
text strings
byte strings
identifiers and codes
formal language strings
regular expression patterns
Standards and regulation
Unicode Standard
RFC 3629 UTF-8
OWASP guidance on input handling
Failure modes and hazards
Encoding errors
Injection vulnerabilities
Normalisation mismatches in comparisons
Also called
+68
Where this came from
wikidata · CC0 1.0
Also registered as vr.tr.string-artifact
Drafted structure
Bundle to layer to finding to question, as the second pass will find it: 4 bundles · 8 layers · 8 findings · 16 questions.
Representation Encoding.
Encoding decides meaning.
Encoding
UTF-8 and others.
Encoding
Encoding.
- Which encoding is used? definition
- Is it declared? boundary
Length
Characters or bytes.
Length
Length.
- Is length counted in bytes, code points or grapheme clusters? definition
- Does that matter here? boundary
Operations Processing.
Operations need care.
Compare
Equality.
Compare
Comparison.
- Should strings be normalised before comparison? boundary
- Is comparison case-sensitive? definition
Search
Patterns.
Search
Searching.
- Which pattern or algorithm finds matches? definition
- How fast is it? measurement
Security Safe handling.
Strings carry attacks.
Escaping
Injection.
Escaping
Escaping.
- Is the string escaped for its output context? boundary
- Are parameterised queries used? boundary
Validation
Formats.
Validation
Validation.
- Is the string validated against the expected format? boundary
- What happens on failure? action
Data Identifiers.
Many identifiers are strings.
Identifiers
Codes.
Identifiers
Identifier strings.
- Should this identifier be stored as a string to keep leading zeros? boundary
- What is its format? definition
Senses
Disambiguation.
Senses
Other senses.
- Is a cord, a musical string or string theory meant? boundary
- Which entry fits? action
What the second pass must settle
- Should string types be separate entries?
- How should encodings be linked?
- How should the cord sense be split off?