structurizr / dsl

Structurizr DSL
https://docs.structurizr.com/dsl
Apache License 2.0
1.41k stars 266 forks source link

accent in description cause validation error #338

Closed PinetNicolas closed 11 months ago

PinetNicolas commented 1 year ago

Description

When you put an accent in description or any field an error occurs:

com.structurizr.dsl.StructurizrDslParserException: Input length = 1 at com.structurizr.dsl.StructurizrDslParser.parse(StructurizrDslParser.java:131) at com.structurizr.cli.export.ExportCommand.run(ExportCommand.java:131) at com.structurizr.cli.StructurizrCliApplication.run(StructurizrCliApplication.java:81) at com.structurizr.cli.StructurizrCliApplication.main(StructurizrCliApplication.java:119)

For a lot of field is not a problem, but i think people need to make description in french or other language with lot of special character.

Steps to reproduce

Create a file with the code sample below.

use cli to validate file : structurizr.bat validate -w .\wtest.dsl

Screenshot

No response

Code sample

workspace {
    model {
        sstest = softwareSystem "Test Application" "é"
    }
}

Configuration

I run under windows Computer locale is french cli version : 1.33.1 dsl version 1.32.0

Severity

Minor

Priority

Low

Resolution

I have no budget, please fix this for free

More information

I just try accent for french language on windows.

PinetNicolas commented 12 months ago

After more investigation, problem come from charset of file. Windows don't use UTF-8 by default. The exception is : java.nio.charset.MalformedInputException. it is more explicit than "Input length = 1"

simonbrowndotje commented 11 months ago

This has been fixed in the DSL parser, but also requires a change to the CLI, which will happen during the next release.