[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Reading files in UTF-8

tomsoft

9/4/2007 7:53:00 PM

Hello everybody,


I am deseperatly trying to read file encoded in UTF-8, to populate
the Globalize database. But it seems that the UTF-8 encoding is not
recognized, and read as an ASCII char. Is there any specific
manipulation to do to achieve this?
Thanks in advance for any help....

Thomas Landspurg
http://www.8m...

3 Answers

Alex Young

9/4/2007 8:13:00 PM

0

tomsoft wrote:
> Hello everybody,
>
>
> I am deseperatly trying to read file encoded in UTF-8, to populate
> the Globalize database. But it seems that the UTF-8 encoding is not
> recognized, and read as an ASCII char. Is there any specific
> manipulation to do to achieve this?
> Thanks in advance for any help....
require 'iconv' is your friend.

http://ruby-doc.org/stdlib/libdoc/iconv/rdoc/...

--
Alex

Nobuyoshi Nakada

9/5/2007 1:25:00 AM

0

Hi,

At Wed, 5 Sep 2007 04:55:04 +0900,
tomsoft wrote in [ruby-talk:267587]:
> I am deseperatly trying to read file encoded in UTF-8, to populate
> the Globalize database. But it seems that the UTF-8 encoding is not
> recognized, and read as an ASCII char. Is there any specific
> manipulation to do to achieve this?

UTF-8 is ASCII compatible, so if your data don't contain any
multi-byte sequences, they should seem like as ASCII data.

--
Nobu Nakada

Stan Pierce

2/21/2011 12:22:00 AM

0


"My two cents" <mytwocents@live.co.uk> wrote in message
news:2396e1d0-f54e-4d78-bfc8-a63b1df4c0dd@o13g2000yql.googlegroups.com...
On Feb 20, 8:24 pm, "SPierce" <ecre...@bigpond.net.au> wrote:
> "My two cents" <mytwoce...@live.co.uk> wrote in
> messagenews:acdf7386-8f3a-> When do you think the point is reached when
> you have to declare war on the
> whole population rather than a few. Is it numbers with a bad attitude
> towards you from evidence ...or what.

It's a matter of practicality. Islamist terrorist organisations
operate very differently from how the Nazi military operated and
require different tactics to combat. Declaring war on Germany was the
best chance to defeat Nazism. Declaring war on Islam would be a
counter-productive measure in the fight against Islamist terrorism.

# How do you know that. You were taught that since school. I had to
suffer that 'practical' policy in the Blitz.

But Hitler and a few others could have been assassinated and saved the world
from one aspect of misery. Or we could have joined Germany to get rid of
the misery of Communism.

Why would sane intelligent men go to war over one man who could be
eliminated overnight with sufficient effort. Practicality I believe in.

So now, after going through all that misery, we are stuck with allowing
pathological maniacs in the country and no effort made to get rid of them.
How stupid is that. Here in Australia we go to great lengths to keep out
bugs in food imports and then let in Muslims who state they are going to
kill us. How practically stupid is that.

Practicality doesn't transfer to academic morons bathed in the brotherly
goodwill of 'social studies' who then advise governments and influence
schoolteachers.

Yes, I do like practicality. I just don't see evidence of it existing. And
you certainly don't have any in Britain.