Description
Flag a BOM at text position zero separately from any BOM found in text.slice(1).
A JSON lexeme is its textual spelling, which differs from the decoded value. Escapes, quotes, raw control characters, and surrounding whitespace must be interpreted in context.
Flag a BOM at text position zero separately from any BOM found in text.slice(1).
When to use this tool
Use JSON String BOM Outside Value Flag when you need a narrowly defined JSON string or separator diagnostic.
How to use the tool and how it works
- Enter text. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read leadingBom, embeddedBom. Inspect leadingBom, embeddedBom before interpreting the associated values.
Flag a BOM at text position zero separately from any BOM found in text.slice(1).1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| text | Text | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| leadingBom | Leading Bom | Required. Boolean. |
| embeddedBom | Embedded Bom | Required. Boolean. |
json
{
"input": {
"text": "{\"a\":1}"
},
"output": {
"leadingBom": true,
"embeddedBom": false
}
} Limitations and assumptions
- The embedded scan always skips the first code unit; neither flag establishes JSON validity or removes a BOM.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Parse the entire document when validity matters; a local pattern match cannot establish complete JSON syntax.
References
Similar or alternative tools
- JSON: JSON Document BOM Offset
Inspect the first UTF-16 unit for U+FEFF.
- JSON String Line Continuation Rejection
Detect a backslash followed by CRLF, CR, or LF.