Skip to content

Truffleruby fails to encode float values with german locale #301

@larskanis

Description

@larskanis

Specs raise several similar issues. The float is encoded with traditional german decimal point , instead of ., so that the value is not recognized by PostgreSQL:

  7) PG::TypeMapByMriType should allow mixed type conversions
     Failure/Error: res = @conn.exec_params( "SELECT $1, $2, $3", [5, 1.23, :TestSymbol], 0, tm )
     
     PG::InvalidTextRepresentation:
       ERROR:  invalid input syntax for type double precision: "1,2300000000000000E+00"

The current sprintf() based implementation is not locale dependent per default on MRI. But it turned out, that it shows the same behavior, as soon as the application calls this for some reason:

setlocale(LC_NUMERIC, "de_DE.utf8");

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