{"record":{"id":"5280cf24d3c36c35","repo":"nodejs/node","slug":"quote-is-c-not-sure-what-to-do-n","errorCode":null,"errorMessage":"Quote is '%c' - not sure what to do.\\n","messagePattern":"Quote is '%c' - not sure what to do\\.\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/escapesrc/escapesrc.cpp","lineNumber":228,"sourceCode":"  \n  if(linestr[pos] != 'u') {\n    fprintf(stderr, \"Not a 'u'?\");\n    return true;\n  }\n\n  pos++; // past 'u'\n\n  bool utf8 = false;\n  \n  if(linestr[pos] == '8') { // u8\"\n    utf8 = true;\n    pos++;\n  }\n  \n  char quote = linestr[pos];\n\n  if(quote != '\\'' && quote != '\\\"') {\n    fprintf(stderr, \"Quote is '%c' - not sure what to do.\\n\", quote);\n    return true;\n  }\n\n  if(quote == '\\'' && utf8) {\n    fprintf(stderr, \"Cannot do u8'...'\\n\");\n    return true;\n  }\n\n  pos ++;\n\n  //printf(\"u%c…%c\\n\", quote, quote);\n\n  for(; pos < linestr.size(); pos++) {\n    if(linestr[pos] == quote) {\n      if(utf8) {\n        return fixu8(linestr, origpos, pos); // fix u8\"...\"\n      } else {\n        return false; // end of quote","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/escapesrc/escapesrc.cpp#L210-L246","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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.","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).","Avoid feeding source files to escapesrc that the scanner cannot classify; exclude such files from the escapesrc build step."],"exampleFix":"// before\nu8data x;            // 'u8' looks like a prefix to the scanner\n\n// after\nu8_data_t x;         // rename so it is not mistaken for a u8 literal","handlingStrategy":"validation","validationCode":"// reject a 'u' not followed by a quote early, before dispatching to fixAt\nchar nx = (pos+1 < linestr.size()) ? linestr[pos+1] : 0;\nif (linestr[pos]=='u' && nx!='\\'' && nx!='\"' && nx!='8') { /* treat as identifier, not a literal */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid identifiers that start with `u`/`u8` in files fed to escapesrc, or insert a space after them.","Run escapesrc on a smoke-test source in CI to catch scanner regressions."],"tags":["icu","escapesrc","string-literal","parsing"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}