From: Tim Roberts Date: 2010-11-13T15:00:15+09:00 Subject: Re: Short question about encoding. Gabriel Lichard wrote: >> Are you perhaps sending the output to a device that does not understand UTF-8? > >I'm guessing that's the issue. >... >But then again when I just do: > >File.open("test.txt", "w"){|x|x << "?"} > >and run it, it makes the test.txt file and saves it without any problems >and with the actual square root character in the file. > >Any idea what I'm doing wrong or why it won't appear in the console? Because your console doesn't use UTF-8. Windows consoles are 8-bit, and the 8-bit encoding they use it determined by your code page. UTF-8 is code page 65001, but its support is sketchy. You can discover your code page by typing "chcp". -- Tim Roberts, timr@probo.com Providenza & Boekelheide, Inc.