Skip to content

Revisit filesystem, internal, external, and locale encodings #2003

Closed
@kddnewton

Description

@kddnewton

These encoding aliases are actually dynamic, and can be changed by user code. For example if you have test.rb:

Encoding.default_external = Encoding::Windows_1253
require_relative "test2"
p $foo.encoding

and test2.rb:

# encoding: external
$foo = "\xb5"

then the whole thing will print #<Encoding:Windows-1253>. Currently we alias a lot of these to UTF-8, and don't handle internal at all. This whole thing needs to be revisited to allow consumers to pass in their encodings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions