{"height":"190","published":"2010-09-29 12:51:28","categories":["ruby"],"description":"Ruby(ms-win32)\u304b\u3089Windows\u5171\u6709\u30d5\u30a1\u30a4\u30eb\u3064\u307e\u308a\u3001NAS\u306e\u3088\u3046\u306a\u30d5\u30a1\u30a4\u30eb\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u306b\u306f\u3001 require 'kconv' $KCODE=\"u\" #SMB\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u308b\u30c6\u30b9\u30c8 path = '//192.168.11.5/\u5171\u6709\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8/test.txt'.tosjis puts path.toutf8 puts open(path).read # => this is test file \u65e5\u672c\u8a9e\u30d5\u30a9\u30eb\u30c0\u540d\u3084\u30d5\u30a1\u30a4\u30eb\u540d\u306fsjis \u3067\u6307\u5b9a\u3059\u308c\u3070\u3044\u3044\u3002\u3061\u306a\u307f\u306b\u30a2\u30af\u30bb\u30b9\u6a29\u9650\u306fRuby\u3092\u5b9f\u884c\u3059\u308b\u30e6\u30fc\u30b6\u30fc\u304c\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u4e0a\u306e\u5171\u6709\u30ea\u30bd\u30fc\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308c\u3070\u3044\u3044\u307f\u305f\u3044\u3002\uff08\u4e8b\u2026","blog_title":"\u305d\u308c\u30de\u30b0\u3067\uff01","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftakuya-1st.hatenablog.jp%2Fentry%2F20100929%2F1285732288\" title=\"Ruby\u3067Windows \u5171\u6709\u30d5\u30a1\u30a4\u30eb\u3078\u306e\u30a2\u30af\u30bb\u30b9 - \u305d\u308c\u30de\u30b0\u3067\uff01\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_url":"https://blog.hatena.ne.jp/takuya_1st/","width":"100%","blog_url":"https://takuya-1st.hatenablog.jp/","version":"1.0","provider_name":"Hatena Blog","image_url":null,"provider_url":"https://hatena.blog","type":"rich","author_name":"takuya_1st","title":"Ruby\u3067Windows \u5171\u6709\u30d5\u30a1\u30a4\u30eb\u3078\u306e\u30a2\u30af\u30bb\u30b9","url":"https://takuya-1st.hatenablog.jp/entry/20100929/1285732288"}