Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.ruby > #7141
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Quintus <quintus@quintilianus.eu> |
| Newsgroups | comp.lang.ruby |
| Subject | Re: Error displaying accented Italian |
| Date | Sun, 20 Sep 2015 21:30:35 +0200 |
| Organization | A noiseless patient Spider |
| Lines | 42 |
| Message-ID | <87y4g099d0.fsf@hades.cable.internal.west-ik.de> (permalink) |
| References | <ms8s8o$9a4$1@speranza.aioe.org> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 8bit |
| Injection-Info | mx02.eternal-september.org; posting-host="31d6aa51cc0bdaa9a1044e85e9a07a87"; logging-data="10687"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19aGv8GzoZKFUoNA/aAsIpA" |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
| Cancel-Lock | sha1:n/y9J7ZcD925M98qhzvLuAADg7I= sha1:Y3XYGUe2OoUHBBDBm50dhS+feLA= |
| Xref | csiph.com comp.lang.ruby:7141 |
Show key headers only | View raw
There are multiple possible causes for this problem. 1) Your text file is not encoded in UTF-8. You need to check that your editor/IDE (i.e. NetBeans) saves the file in UTF-8. 2) Your editor’s output windows is not set up for UTF-8 output. You need to reconfigure your IDE to expect your program’s output in UTF-8. 3) You are using the Windows commandline (DOS box). You need to change the Windows commandline’s configuration to UTF-8 instead of Windows-1252. Background: Windows systems in western countries by default work with the Windows-1252 encoding, which is a variant of ISO-8859-1. Both of these encodings are incompatible with Ruby’s default encoding, which is UTF-8. When you try to display a UTF-8-encoded text in a textbox that expects its input to be Windows-1252, you’ll receive the results you got. The proper solution is to change the output program to expect UTF-8, which is the correct modern-day encoding to use rather than the archaic Windows-* encodings from the 90ies, which is what I have recommended above. It is AFAIK also possible to have Ruby automatically transcode everything to Windows-1252, but I don’t know how. Also, UTF-8 can contain many more characters then Windows-1252, and it is likely that sooner or later you run into problems with characters that can’t be represented in Windows-1252. Hence, the better solution is to change your tooling to expect UTF-8. Valete, Quintus. -- #!/sbin/quintus Blog: http://www.guelkerdev.de GnuPG key: F1D8799FBCC8BC4F
Back to comp.lang.ruby | Previous | Next — Previous in thread | Find similar
Error displaying accented Italian bughiman <tex_willwr@invalid.com> - 2015-09-03 09:18 +0200 Re: Error displaying accented Italian Quintus <quintus@quintilianus.eu> - 2015-09-20 21:30 +0200
csiph-web