https://gitlab.synchro.net/main/sbbs/-/commit/9d1f0d502a5ef88ad5d34df0
Added Files:
exec/tests/source/skipif utf8.js
Modified Files:
docs/v322_new.md exec/load/msgutils.js sha1.js web/root/sajax-forum/client_functions.xjs xtrn/druglord/Drug.js atm.js druglord.js pocket.js xtrn/fatfish/Fish.js xtrn/hamtest/Extra.js General.js xtrn/lord/gravyard/gravyard.js xtrn/lord/outhouse/outhouse.js xtrn/mc/mc.js
Log Message:
Stock JS: replace raw CP437/Windows-1252 bytes; test for valid UTF-8
Thirteen stock scripts held raw bytes in the 0x80-0xFF range that are not
valid UTF-8. SpiderMonkey 1.8.5 reads source byte-for-byte, so they work
today, but later SpiderMonkey versions compile source as UTF-8, where
these bytes are malformed, and UTF-8 editors show or save them as garbage.
- CP437 characters in output strings (DrugLord's pound sign, Milliways
Casino's logo box, the LORD Outhouse and Graveyard IGMs' decorations)
are now \xNN escapes, so the output is byte-for-byte unchanged.
Milliways Casino builds its 46-character borders once.
- msgutils.js: the middle-dot (0xFA) in the backquote-to-ESC regex is now
\xFA; it matches exactly the same text.
- hamtest: General.js used Windows-1252 curly quotes, apostrophes and
no-break spaces, which showed as accented letters on a CP437 terminal;
they are now plain ASCII. Extra.js's two CP437 no-break spaces are now
spaces.
- Comments in sha1.js, client_functions.xjs and Fish.js use ASCII.
Compiled and decompiled with SpiderMonkey 1.8.5, the escaped files are identical to the originals; Milliways Casino's logon screen output is byte-identical.
New test exec/tests/source/utf8.js fails if any .js/.ssjs/.xjs file under exec/, xtrn/, web/ or webv4/ is not valid UTF-8 (rejecting overlong
forms, surrogates and truncated sequences). It runs only in a source
checkout, since a live install's xtrn/ also holds third-party doors.
Fixes #1341
Co-Authored-By: Claude Opus 5.5 <
noreply@anthropic.com>
---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net