Skip to content

Filenames with non-ascii chars are not encoded #8

Closed

Description

@jbrichau

The GemStone primitives on GsFile are not encoding a filename with non-ascii chars. As a consequence, users must not forget to properly encode these filenames before using the primitives.

For example, executing the following in GemStone 2.4, 3.1 or 3.2 does not open the file because it does not find it.
GRPlatform current contentsOfFile: 'fichier français à importer.txt' binary: false

If we encode the filename, it works:
GRPlatform current contentsOfFile: 'fichier français à importer.txt' encodeAsUTF8 binary: false

I think this might be a GemStone issue that could be fixed if the primitives take the user locale into account. What do you think @dalehenrich ? In the meantime, we might want to abstract this into Grease with a locale that can be set in GRPlatform and that is subsequently used to encode the filename.

Activity

  1. dalehenrich commented on Nov 7, 2014

    @dalehenrich
    Member

    Johan,

    Good point, I'll submit an internal bug and see what the other folks here
    think... Thanks!

    Dale

    On Fri, Nov 7, 2014 at 10:37 AM, Johan Brichau [email protected]
    wrote:

    The GemStone primitives on GsFile are not encoding a filename with
    non-ascii chars. As a consequence, users must not forget to properly encode
    these filenames before using the primitives.

    For example, executing the following in GemStone 2.4, 3.1 or 3.2 does not
    open the file because it does not find it.
    GRPlatform current contentsOfFile: 'fichier français à importer.txt'
    binary: false

    If we encode the filename, it works:
    GRPlatform current contentsOfFile: 'fichier français à importer.txt'
    encodeAsUTF8 binary: false

    I think this might be a GemStone issue that could be fixed if the
    primitives take the user locale into account. What do you think
    @dalehenrich https://github.com/dalehenrich ? In the meantime, we might
    want to abstract this into Grease with a locale that can be set in
    GRPlatform and that is subsequently used to encode the filename.

    —
    Reply to this email directly or view it on GitHub
    GsDevKit#8.

  2. dalehenrich commented on Nov 7, 2014

    @dalehenrich
    Member

    Internal Bug44786 ... if we do make the change it will not be available until 3.3 (or possibly 3.2.4 if deemed necessary), so perhaps the change to Grease should be done as an interim measure..

  3. jbrichau commented on Nov 7, 2014

    @jbrichau
    MemberAuthor

    Thx Dale. I will try to get that one in for the next Grease version.

  4. dalehenrich commented on Jun 16, 2015

    @dalehenrich
    Member

    This Bug44786 is fixed in 3.3 ....

  5. marschall commented on Sep 5, 2017

    @marschall
    Contributor

    Since 3.3 is out, 3.4 is about to ship and it's now been almost three years, do you still plan to fix this?

  6. jbrichau commented on Sep 8, 2017

    @jbrichau
    MemberAuthor

    We have a fix for this in our own codebase but I'm not sure it can be applied in general. I'm lacking time to take this, so, no, won't fix.

  7. added a commit that references this issue on Feb 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions