[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-core
Subject:    [ruby-core:104426] [Ruby master Bug#9245] Kernel::system gives wrong output for utf-8 characters on 
From:       merch-redmine () jeremyevans ! net
Date:       2021-06-28 17:49:46
Message-ID: redmine.journal-92672.20210628174945.7676 () ruby-lang ! org
[Download RAW message or body]

Issue #9245 has been updated by jeremyevans0 (Jeremy Evans).

Backport deleted (1.9.3: UNKNOWN, 2.0.0: UNKNOWN)
Status changed from Open to Closed

This appears to be fixed as of Ruby 2.1.  I was able to recreate the issue in 2.0, \
but not in 2.1. I also tested the latest RubyInstaller-head, and the problem is still \
fixed.

----------------------------------------
Bug #9245: Kernel::system gives wrong output for utf-8 characters on windows under \
utf-8 console https://bugs.ruby-lang.org/issues/9245#change-92672

* Author: leifcr (Leif Ringstad)
* Status: Closed
* Priority: Normal
* Assignee: cruby-windows
* ruby -v: ruby 2.0.0p353 (2013-11-22) [i386-mingw32]
----------------------------------------
Under windows console running in utf-8 mode (chcp 65001), it is expected to print \
utf-8 encoded characters in a script from system calls correctly.

To reproduce, create a file in utf-8 format running this:
---
# test.rb
# encoding: UTF-8
system "echo abcæøå"
---

output:
Make sure to set utf-8 console on windows
> chcp 65001 
> ruby test.rb
abcæøå 

The expected output is:
abcæøå

Running the following on a command prompt gives the correct output:
> ruby -e "system 'echo abcæøå'"

abcæøå

The problem comes clear when running other Windows commands through command line \
parameters e.g: system("notepad.exe abcæøå.txt")

Notepad will complain not finding the file abcæøå.txt instead of abcæøå.txt 

It seems that there is an internal encoding done before running the command.





-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic