[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Unicode Character 'SUBSTITUTE' (U+001A) troubles...

Robert Lehman

3/17/2009 4:01:00 PM

I'm implementing a version of the "Mini-AES" (http://findart...
p/articles/mi_qa3926/is_200210/ai_n9129484) in Ruby and have all of
the bit shifts and stuff working..

The problem I'm having is with the file input. When ever the input
file has the character U+001A (http://www.fileformat.info/inf...
char/001a/index.htm), it stops reading in the line (and thus doesn't
complete the whole cipher text).

Basically, here is the code that I'm using to read the input:
fin = File.open(ARGV[0], 'r')
plainText = ""
while (line = fin.gets)
plainText += line
end
fin.close

Here is a sample line of cipher text:
týH†a¤j{ÀìyMšyMÇÜ«àÃSÙ¿àé4þF&käj{Àì

if I read this line in, it would only read "týH†a¤j{ÀìyMšyM" and skip
the rest.
11 Answers

Robert Lehman

3/17/2009 4:30:00 PM

0

On Mar 17, 12:01 pm, Robert Lehman <gri...@gmail.com> wrote:
> I'm implementing a version of the "Mini-AES" (http://findart...
> p/articles/mi_qa3926/is_200210/ai_n9129484) in Ruby and have all of
> the bit shifts and stuff working..
>
> The problem I'm having is with the file input.  When ever the input
> file has the character U+001A (http://www.fileformat.info/inf...
> char/001a/index.htm), it stops reading in the line (and thus doesn't
> complete the whole cipher text).
>
> Basically, here is the code that I'm using to read the input:
> fin = File.open(ARGV[0], 'r')
> plainText = ""
> while (line = fin.gets)
>   plainText += line
> end
> fin.close
>
> Here is a sample line of cipher text:
> týH†a¤j{ÀìyMšyM ÇÜ«àÃSÙ¿àé4þF&käj{Àì
>
> if I read this line in, it would only read "týH†a¤j{ÀìyMšyM" and skip
> the rest.

I'm using Windows btw.

Tim Hunter

3/17/2009 5:34:00 PM

0

Robert Lehman wrote:
> On Mar 17, 12:01�pm, Robert Lehman <gri...@gmail.com> wrote:
>> fin = File.open(ARGV[0], 'r')
>> the rest.
> I'm using Windows btw.

Open the file with "rb" instead of "r".
--
Posted via http://www.ruby-....

Robert Lehman

3/17/2009 9:20:00 PM

0

On Mar 17, 1:33 pm, Tim Hunter <rmag...@gmail.com> wrote:
> Robert Lehman wrote:
> > On Mar 17, 12:01 pm, Robert Lehman <gri...@gmail.com> wrote:
> >> fin = File.open(ARGV[0], 'r')
> >> the rest.
> > I'm using Windows btw.
>
> Open the file with "rb" instead of "r".
> --
> Posted viahttp://www.ruby-....

I tried using rb and the output spits out 1/2 plain text and 1/2
random Unicode.

Our project is only allowed to be run on Linux and it seems to work
fine on there, so I'll just leave the Windows problem alone unless
someone suggests a good fix.

Alert

7/5/2011 3:53:00 PM

0

On Jul 1, 8:46 pm, Anne Onime <anonym...@rip.ax.lt> wrote:
> On 6/28/2011 9:17 AM, Alert wrote:
>
> >> Maybe I'll bring my wife and stay in the city that night...
>
> > That is so kind of you. Imagine how upset she would be if you went to
> > NYC and saw DannyPOrky without her. She would be left at home alone
> > to
> > drink and probably fuck the postman in your absence you lazy cunt.
>
> > I was there last year. I may be thereagainthis year.
>
> > However, I bet you won't be.
>
> > And I guarantee you don't have the nerve to come toMcSorley's, meet
> > me and say this to my face.
>
> Wow you must think you are really tough since you keep posting this
> like a mental retard thinking it will change things.
>
> Everybody must be quaking in their boots over the fact that you are
> going to hit some unknown troll in the face with your purse.
>
> Meanwhile you go toMcSorley'swhile I'll be at your house fucking
> your wife real good and dump load after load in her hairy guido pussy.

That's funny "EVERYBODY must be quaking in their boots" -- only YOU
should be quaking in your boots.

Post whatever nonesense you'd like, I'm sure you've already learned
that your potty-mouthed insults (which -- let's face it -- have no
basis in reality because you've never met me and don't know enough
about me to speak intelligently) are best expressed online where's
little risk of you facing any consequences.

Yet, the fact remains: I GUARANTEE you don't have the courage to say
these things to me in person.

from_me_to_you

7/5/2011 10:41:00 PM

0

On Jul 1, 11:32 pm, "who?" <yourimageunre...@sbcglobal.net> wrote:
> On Jul 1, 7:46 pm, Anne Onime <anonym...@rip.ax.lt> wrote:
>
>
>
>
>
> > On 6/28/2011 9:17 AM, Alert wrote:
>
> > >> Maybe I'll bring my wife and stay in the city that night...
>
> > > That is so kind of you. Imagine how upset she would be if you went to
> > > NYC and saw DannyPOrky without her. She would be left at home alone
> > > to
> > > drink and probably fuck the postman in your absence you lazy cunt.
>
> > > I was there last year. I may be there again this year.
>
> > > However, I bet you won't be.
>
> > > And I guarantee you don't have the nerve to come to McSorley's, meet
> > > me and say this to my face.
>
> > Wow you must think you are really tough since you keep posting this
> > like a mental retard thinking it will change things.
>
> > Everybody must be quaking in their boots over the fact that you are
> > going to hit some unknown troll in the face with your purse.
>
> > Meanwhile you go to McSorley's while I'll be at your house fucking
> > your wife real good and dump load after load in her hairy guido pussy.
>
> It doesn't take a brain surgeon to know who you are. You came on
> this group....with perfect timing, and you aren't fooling anybody.
> Quit whining.

I agree, Jeff.

Danny McEvoy

7/6/2011 12:05:00 AM

0

On Jul 5, 4:53 pm, Alert <alert6...@my-deja.com> wrote:
> On Jul 1, 8:46 pm, Anne Onime <anonym...@rip.ax.lt> wrote:
>
>
>
>
>
> > On 6/28/2011 9:17 AM, Alert wrote:
>
> > >> Maybe I'll bring my wife and stay in the city that night...
>
> > > That is so kind of you. Imagine how upset she would be if you went to
> > > NYC and saw DannyPOrky without her. She would be left at home alone
> > > to
> > > drink and probably fuck the postman in your absence you lazy cunt.
>
> > > I was there last year. I may be thereagainthis year.
>
> > > However, I bet you won't be.
>
> > > And I guarantee you don't have the nerve to come toMcSorley's, meet
> > > me and say this to my face.
>
> > Wow you must think you are really tough since you keep posting this
> > like a mental retard thinking it will change things.
>
> > Everybody must be quaking in their boots over the fact that you are
> > going to hit some unknown troll in the face with your purse.
>
> > Meanwhile you go toMcSorley'swhile I'll be at your house fucking
> > your wife real good and dump load after load in her hairy guido pussy.
>
> That's funny "EVERYBODY must be quaking in their boots" -- only YOU
> should be quaking in your boots.
>
> Post whatever nonesense you'd like, I'm sure you've already learned
> that your potty-mouthed insults (which -- let's face it -- have no
> basis in reality because you've never met me and don't know enough
> about me to speak intelligently) are best expressed online where's
> little risk of you facing any consequences.
>
> Yet, the fact remains: I GUARANTEE you don't have the courage to say
> these things to me in person.- Hide quoted text -
>
> - Show quoted text -

Be good to see you again in Maccy Soileys Alert..you can wear my hat
again!! Seems it's the 20th August a Saturday night..be good to catch
up again..there appears to be a mentally unstable troll in our midst
who really shouldn't be embraced in any way..Just a thought..

Dany

from_me_to_you

7/6/2011 12:16:00 AM

0

On Jul 5, 7:04 pm, Danny McEvoy <thewalruswasda...@gmail.com> wrote:
> On Jul 5, 4:53 pm, Alert <alert6...@my-deja.com> wrote:
>
>
>
>
>
> > On Jul 1, 8:46 pm, Anne Onime <anonym...@rip.ax.lt> wrote:
>
> > > On 6/28/2011 9:17 AM, Alert wrote:
>
> > > >> Maybe I'll bring my wife and stay in the city that night...
>
> > > > That is so kind of you. Imagine how upset she would be if you went to
> > > > NYC and saw DannyPOrky without her. She would be left at home alone
> > > > to
> > > > drink and probably fuck the postman in your absence you lazy cunt.
>
> > > > I was there last year. I may be thereagainthis year.
>
> > > > However, I bet you won't be.
>
> > > > And I guarantee you don't have the nerve to come toMcSorley's, meet
> > > > me and say this to my face.
>
> > > Wow you must think you are really tough since you keep posting this
> > > like a mental retard thinking it will change things.
>
> > > Everybody must be quaking in their boots over the fact that you are
> > > going to hit some unknown troll in the face with your purse.
>
> > > Meanwhile you go toMcSorley'swhile I'll be at your house fucking
> > > your wife real good and dump load after load in her hairy guido pussy.
>
> > That's funny "EVERYBODY must be quaking in their boots" -- only YOU
> > should be quaking in your boots.
>
> > Post whatever nonesense you'd like, I'm sure you've already learned
> > that your potty-mouthed insults (which -- let's face it -- have no
> > basis in reality because you've never met me and don't know enough
> > about me to speak intelligently) are best expressed online where's
> > little risk of you facing any consequences.
>
> > Yet, the fact remains: I GUARANTEE you don't have the courage to say
> > these things to me in person.- Hide quoted text -
>
> > - Show quoted text -
>
> Be good to see you again in Maccy Soileys Alert..you can wear my hat
> again!! Seems it's the 20th August a Saturday night..be good to catch
> up again..there appears to be a mentally unstable troll in our midst
> who really shouldn't be embraced in any way..Just a thought..
>
> Dany

Exactly, Danny!

After all, would you use your hands to pick poison ivy and a rose to
make something for your lapel?

abe slaney

7/6/2011 3:50:00 AM

0

On Jul 5, 8:15 pm, The Lone Star <from_me_to_...@comcast.net> wrote:

> Exactly, Danny!
>
> After all, would you use your hands to pick poison ivy and a rose to
> make something for your lapel?

Obsess much?
A 12-year old could read the posts and tell they're not from the same
person. And you taught English? I doubt very much that either Jeff or
Danny believe as you do. And you've pulled the same kind of lame and
baseless accusations against me...no matter how many times I told you
plainly that I only post here under one nym you continually intimated
otherwise. What need would PR have to snipe from a pseudonym? Did you
ever get the feeling he was holding back and not saying exactly what
he thought under his regular nym? Think.

Eric Ramon

7/6/2011 5:50:00 AM

0

On Jul 5, 8:50 pm, abe slaney <abesla...@yahoo.com> wrote:
> On Jul 5, 8:15 pm, The Lone Star <from_me_to_...@comcast.net> wrote:
>
> > Exactly, Danny!
>
> > After all, would you use your hands to pick poison ivy and a rose to
> > make something for your lapel?
>
> Obsess much?
> A 12-year old could read the posts and tell they're not from the same
> person. And you taught English? I doubt very much that either Jeff or
> Danny believe as you do. And you've pulled the same kind of lame and
> baseless accusations against me...no matter how many times I told you
> plainly that I only post here under one nym you continually intimated
> otherwise. What need would PR have to snipe from a pseudonym? Did you
> ever get the feeling he was holding back and not saying exactly what
> he thought under his regular nym? Think.

a. who it is is irrelevant since the posts are too stupid to read in a
serious way.
b. PR puts some thoughts into his insults. These are nomen-ish. Is
that iBen? I don't know the ins and outs of pseudonyms and I don't
care. However, yes, you're right, it's clearly not PR.

Fattuchus

7/6/2011 8:56:00 AM

0

On Jul 5, 11:50 pm, abe slaney <abesla...@yahoo.com> wrote:
> On Jul 5, 8:15 pm, The Lone Star <from_me_to_...@comcast.net> wrote:
>
> > Exactly, Danny!
>
> > After all, would you use your hands to pick poison ivy and a rose to
> > make something for your lapel?
>
> Obsess much?
> A 12-year old could read the posts and tell they're not from the same
> person. And you taught English? I doubt very much that either Jeff or
> Danny believe as you do. And you've pulled the same kind of lame and
> baseless accusations against me...no matter how many times I told you
> plainly that I only post here under one nym you continually intimated
> otherwise. What need would PR have to snipe from a pseudonym? Did you
> ever get the feeling he was holding back and not saying exactly what
> he thought under his regular nym? Think.

I don't think anyone here believes for one second you are the
troll(s).