scan_simulate_dialogue_test.mjs 707 B

12345678910111213141516
  1. import { readFileSync } from 'node:fs';
  2. const p =
  3. 'd:/work/ylrz_saas/java/fs-service/src/test/java/com/fs/company/service/workflow/deepdialogue/SimulateDialogueFlowDiagnosticTest.java';
  4. const raw = readFileSync(p);
  5. const t = raw.toString('utf8');
  6. console.log('BOM', raw.length >= 3 && raw[0] === 0xef && raw[1] === 0xbb && raw[2] === 0xbf);
  7. console.log('FFFD', t.includes('\uFFFD'));
  8. console.log('u escapes', (t.match(/\\u[0-9a-fA-F]{4}/g) || []).length);
  9. console.log('has Ä£Äâ', t.includes('\u6a21\u62df'));
  10. console.log('has ÇÛ²Ë', t.includes('\u82b9\u83dc'));
  11. t.split('\n').forEach((line, i) => {
  12. if (line.includes('\uFFFD')) {
  13. console.log('FFFD line', i + 1, line.trim().slice(0, 120));
  14. }
  15. });