Skip to content

Interpolated string issue on Thai culture #19367

@iminashi

Description

@iminashi

There appears to be a bug where (at least) on Thai culture settings, closing parentheses appear into interpolated strings. Seems to be an F# specific issue?

Repro steps

open System.Globalization
open System.Threading

type Test = { Name: string } with override this.ToString() = this.Name

let staticString = "Static string"
let number = 1.5
let obj = { Name = "Test" }

Thread.CurrentThread.CurrentCulture <- CultureInfo("th")

let interpolated1 = $"{obj} {number} {staticString}"
let interpolated2 = $"%O{obj} %O{number} %s{staticString}"
let formatted = sprintf "%O %O %s" obj number staticString

printfn "%s" interpolated1
printfn "%s" interpolated2
printfn "%s" formatted

Expected behavior

Prints:

Test 1.5 Static string
Test 1.5 Static string
Test 1.5 Static string

Actual behavior

Prints:

Test) 1.5) Static string)
Test 1.5 Static string
Test 1.5 Static string

Known workarounds

As in the above example, using format specifiers appears to prevent this.

Related information

  • Windows 11

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions