Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.ruby > #6929
| Newsgroups | comp.lang.ruby |
|---|---|
| Date | 2014-03-06 04:04 -0800 |
| Message-ID | <ef50912f-145b-465d-9345-196c58e43ef4@googlegroups.com> (permalink) |
| Subject | How change charset of file |
| From | hirogeek@gmail.com |
Hi,
I try to create file with utf-8 charset.
If I do
File.open("test.xml", 'w:utf-8') { |f| f.write('<?xml version="1.0" encoding="UTF-8"?>') }
file -I test.xml -> test.xml: application/xml; charset=us-ascii
and I do
File.open("test.xml", 'w:utf-8') { |f| f.write('<?xml version="1.0" encoding="UTF-8" é?>') }
I add an utf-8 char (é)
file -I test.xml -> test.xml: application/xml; charset=utf-8
Ruby seem to be adaptative. But I would have alwayse charset utf-8. Can we do this ?
I use ruby 2.1.1
Back to comp.lang.ruby | Previous | Next — Next in thread | Find similar
How change charset of file hirogeek@gmail.com - 2014-03-06 04:04 -0800 Re: How change charset of file Quintus <quintus@quintilianus.eu> - 2014-03-16 19:30 +0000
csiph-web