Issue #5206 has been updated by naruse (Yui NARUSE).

Assignee changed from naruse (Yui NARUSE) to matz (Yukihiro Matsumoto)

ko1 (Koichi Sasada) wrote:
> (2012/07/03 14:46), usa (Usaku NAKAMURA) wrote:
>  > Status changed from Closed to Assigned
>  > 
>  > I think that it is good for warning, but isn't only the time of -w option being specified? 
>  
>  I often use -Ks option for temporary ruby scripts because my editor's
>  default encoding is CP932.  And I always run ruby scripts with -w option.
>  
>  I'm happy if there are any other way to specify script encoding for such
>  disposable scripts.

If ALLOW_DEFAULT_SOURCE_ENCODING macro is enabled, you can use --source-encoding option.
----------------------------------------
Feature #5206: ruby -K should warn
https://bugs.ruby-lang.org/issues/5206#change-27804

Author: drbrain (Eric Hodel)
Status: Assigned
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: 


When ruby is run with -K it changes the default encoding of all files even when that may be incompatible with the source.  If many libraries are used -K may cause incorrect behavior.

Now that we have the "coding:" magic comment ruby should warn if the -K flag is used and suggest that "coding:" magic comment be used instead.


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