Skip to content

Commit dd9279e

Browse files
authored
Merge pull request #190 from kojix2/fix-win-encoding
fix encoding for Windows
2 parents 02f0b95 + 648d6d1 commit dd9279e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/iruby/jupyter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def windows_user_appdata
3737
case call_SHGetFolderPathW(Fiddle::NULL, csidl_appdata, Fiddle::NULL, 0, path)
3838
when 0
3939
len = (1 ... (path.size/2)).find {|i| path[2*i, 2] == "\0\0" }
40-
path = path.to_str(2*len).force_encoding(Encoding::UTF_16LE)
40+
path = path.to_str(2*len).encode(Encoding::UTF_8, Encoding::UTF_16LE)
4141
else
4242
ENV.fetch('APPDATA', '')
4343
end

0 commit comments

Comments
 (0)