nodejs/node · error

Quote is '%c' - not sure what to do.\n

Error message

Quote is '%c' - not sure what to do.\n

What it means

After consuming 'u' (and optional '8'), escapesrc expects the next character to be a single or double quote that delimits the string/char literal. If it is neither '\'' nor '"', the tool cannot tell where the literal begins and bails on the line.

Solutions

  1. Inspect the reported line and ensure any u/u8/U/L literal is written as a contiguous prefix+quote (e.g. u8"...", u'x') with no intervening characters.
  2. If the 'u' is part of an identifier, rename it or add a space so the scanner does not treat it as a prefix (the scan heuristic triggers on the bare letter).
  3. Avoid feeding source files to escapesrc that the scanner cannot classify; exclude such files from the escapesrc build step.

Example fix

// before
u8data x;            // 'u8' looks like a prefix to the scanner

// after
u8_data_t x;         // rename so it is not mistaken for a u8 literal
Defensive patterns

Strategy: validation

Validate before calling

// reject a 'u' not followed by a quote early, before dispatching to fixAt
char nx = (pos+1 < linestr.size()) ? linestr[pos+1] : 0;
if (linestr[pos]=='u' && nx!='\'' && nx!='"' && nx!='8') { /* treat as identifier, not a literal */ }

Prevention

When it happens

Trigger: Source text where a 'u' token is immediately followed by a non-quote character, such as an identifier starting with u (e.g. `unsigned`, `uint32_t`), `u8` used as part of a longer identifier, or whitespace/formatting that defeats the scanner's prefix detection.

Common situations: Variable/type names beginning with u that the line scanner misclassifies as a string prefix; macro expansions producing `u` adjacent to non-quote text; whitespace-sensitive C++ where the scanner expects no space between prefix and quote.

Related errors


AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13). Data as JSON: /api/errors/5280cf24d3c36c35. Report an issue: GitHub.

Appendix: source

Thrown at deps/icu-small/source/tools/escapesrc/escapesrc.cpp:228

  
  if(linestr[pos] != 'u') {
    fprintf(stderr, "Not a 'u'?");
    return true;
  }

  pos++; // past 'u'

  bool utf8 = false;
  
  if(linestr[pos] == '8') { // u8"
    utf8 = true;
    pos++;
  }
  
  char quote = linestr[pos];

  if(quote != '\'' && quote != '\"') {
    fprintf(stderr, "Quote is '%c' - not sure what to do.\n", quote);
    return true;
  }

  if(quote == '\'' && utf8) {
    fprintf(stderr, "Cannot do u8'...'\n");
    return true;
  }

  pos ++;

  //printf("u%c…%c\n", quote, quote);

  for(; pos < linestr.size(); pos++) {
    if(linestr[pos] == quote) {
      if(utf8) {
        return fixu8(linestr, origpos, pos); // fix u8"..."
      } else {
        return false; // end of quote

View on GitHub (pinned to 1b2de5e052)