Skip to content

foxvm rejects Windows-1252 source files: "stream did not contain valid UTF-8" #29

Open

Description

@ilpconsulting

Visual FoxPro source files are normally saved in the ANSI code page, Windows-1252 on Western European systems. Any .prg containing an accented letter, even inside a comment, is rejected before it is parsed.

Repro

* Prezzo unità
? "città"

(saved as Windows-1252: à = byte 0xE0)

foxvm check 02_cp1252.prg → cannot read 02_cp1252.prg: stream did not contain valid UTF-8

Expected

Read source files the way VFP does: in the current code page, or one given by SET CPCOMPILE or a CLI option such as --codepage 1252. At minimum, fall back to 1252 when the input isn't valid UTF-8. The data engine already handles single-byte DBF code pages (#22); source files need the same.

Workaround

Converting copies to UTF-8 works, but then the files no longer round-trip with VFP 9, which matters while both runtimes are in use.

Environment: foxvm 0.1.0-nightly.20261007.f38230f, win-x64.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions