Skip to content

[Question] How come the Windows fix for test SlimSerializerTest.listWithSurrogatePairSerialize (change 61a0841) is any sane ? #1595

Description

@laurent-larizza

** General Description **

It seems that the test mentioned in the subject has been amended subsequently to an effort of making the Slim protocol tests work on Windows (#1477)

The change was brought to the test, and states "Surrogate Length is different depending on OS". The change has been accepted into the codebase. Why so ?

In SLiM, the strings must be prefixed by their length as "The six+ digits are the number of UTF-16 code units in the string", that's what the doc says at https://fitnesse.org/FitNesse/UserGuide/WritingAcceptanceTests/SliM/SlimProtocol.html

The source file is encoded in UTF-8, and the supplementary character of the test is spliced directly into the string literal as F0 9F 80 9C twice, so correctly UTF-8 encoded. I suspect the real issue on Windows was because the compiler misinterpreted the string as being 8 windows-1252 characters instead of 5 UTF-8-encoded characters. I believe the correct fix for the test to be charset-independent would have been to replace the supplementary character by its correct escape sequence, namely \uD83C\uDC1C. (The actual surrogate pair)

Does anyone agree with my analysis ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions