-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
Environment
jruby 9.1.0.0 (2.3.0) 2016-05-02 a633c63 Java HotSpot(TM) 64-Bit Server VM 25.92-b14 on 1.8.0_92-b14 +jit [mswin32-x86_64]
Expected Behavior
mri
irb(main):007:0> Encoding.find("filesystem")
=> #<Encoding:Windows-1252>
irb(main):008:0> Encoding.default_external
=> #<Encoding:IBM852>Actual Behavior
jruby
irb(main):023:0> Encoding.find("filesystem")
=> #<Encoding:IBM852>
irb(main):024:0> Encoding.default_external
=> #<Encoding:IBM852>it looks like Encoding.find("filesystem") is just an alias to Encoding.default_external
case FILESYSTEM:
// This needs to do something different on Windows. See encoding.c,
// in the enc_set_filesystem_encoding function.
return runtime.getDefaultExternalEncoding();for windows the mri's logic is a little bit different
int Init_enc_set_filesystem_encoding(void)
{
int idx;
#if defined NO_LOCALE_CHARMAP
# error NO_LOCALE_CHARMAP defined
#elif defined _WIN32 || defined __CYGWIN__
char cp[SIZEOF_CP_NAME];
CP_FORMAT(cp, AreFileApisANSI() ? GetACP() : GetOEMCP());
idx = rb_enc_find_index(cp);
if (idx < 0) idx = ENCINDEX_ASCII;
#else
idx = rb_enc_to_index(rb_default_external_encoding());
#endif
return idx;
}Reactions are currently unavailable