Skip to content

Client-side mode: accented characters in test class corrupted during load #68

@GendronAC

Description

@GendronAC

Summary

In client-side editing mode on Windows, test classes containing accented characters (é, è, à, etc.) fail when run via "Run Test" but pass via "Debug Test".

Related: intersystems-community/vscode-objectscript#692

Minimal reproduction

Two .cls files in the workspace (UTF-8 without BOM):

CSampleData.cls — already compiled on server, not reloaded by the test run:

Class Tests.Unit.CSampleData Extends %RegisteredObject
{
ClassMethod returnsData() As %String
{
   return "Différents"
}
}

CSample.cls — test class, reloaded by $System.OBJ.Load before execution:

Class Tests.Unit.CSample Extends %UnitTest.TestCase
{
Method TestMe()
{
   do $$$AssertEquals(##class(Tests.Unit.CSampleData).returnsData(), "Différents")
}
}

Run Test output (FAILS)

Loading file d:\...\CSample.cls as udl
AssertEquals:##class(CSampleData).returnsData()== "Diff?ents" was 'Différents' (failed)

The string "Différents" in CSample.cls is corrupted during load. The é (UTF-8 bytes C3 A9) becomes ?.

Debug Test output (PASSES)

AssertEquals: (passed)

Debug works because the preload uses /load/debug, then the actual run uses /noload — so the already-compiled (correct) class is used.

Byte-level evidence

  • Source .cls file on disk: UTF-8, no BOM. é = 0xC3 0xA9
  • CSampleData.returnsData() internal bytes on server: $ASCII = 233 (correct, U+00E9)
  • After $System.OBJ.Load of CSample.cls: the literal "Différents" is corrupted

Environment

  • Windows 11, French locale
  • IRIS for Windows (x86-64) 2025.1.3 (Build 481_1U) Tue Feb 3 2026 15:26:39 EST
  • Default I/O translate table: UTF8 ($zutil(96,18,0) returns UTF8)
  • Client-side editing mode
  • ^%SYS("CSP","DefaultFileCharset")="UTF-8" was tried — no effect (expected, since this affects CSP file writes, not $System.OBJ.Load) csp-Files encoding issue vscode-objectscript#692

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