Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Read-line strangeness
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
cbbrowne  
View profile  
 More options Nov 9 2000, 9:51 pm
Newsgroups: comp.lang.lisp
From: cbbro...@hex.net
Date: Fri, 10 Nov 2000 02:48:03 GMT
Local: Thurs, Nov 9 2000 9:48 pm
Subject: Read-line strangeness
I've got a CL filter I'm using to process news postings (this very
post ran through it); I am running into the following problem:

> (processnews)

Process file:C:\HOME\NEWS\drafts\drafts\5
Output location: C:\HOME\movehome\news\x3182784084.5

*** - invalid byte #x81 in CHARSET:ISO-8859-1 conversion
1. Break NEWS[2]> where

EVAL frame for form (READ-LINE INS NIL 'EOF)

By looking at a backtrace, I can see that what it's "freaking at" is
that it's reading a line with a name that contains a "funny
international accent," which presumably isn't fitting well into
ISO-8859-1.

Relevant code fragment:
(with-open-file (inp-stream input-file)
                (format outs "From: cbbro...@hex.net~%")
                (format outs "Reply-to: cbbro...@hex.net~%")
                (do ((line (read-line inp-stream)
                           (read-line inp-stream nil 'eof)))
                            ((eq line 'eof) "Reached end of file.")
                      (rewrite-line line outs)))

Now, I had been _thinking_ that all this readtable stuff that has been
causing such bluster was pretty irrelevant to me, and that I could,
for the time being, just ignore it from a practical perspective.  

It now seems otherwise; it seems as if I need to attach some sort of
readtable information _somewhere_; I'm not quite clear on where.
--
(concatenate 'string "cbbrowne" "@hex.net")
<http://www.ntlug.org/~cbbrowne/>
Economists are still trying to figure out why the girls with the least
principle draw the most interest.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kent M Pitman  
View profile  
 More options Nov 9 2000, 10:08 pm
Newsgroups: comp.lang.lisp
From: Kent M Pitman <pit...@world.std.com>
Date: Fri, 10 Nov 2000 03:06:36 GMT
Local: Thurs, Nov 9 2000 10:06 pm
Subject: Re: Read-line strangeness

cbbro...@hex.net writes:
> Relevant code fragment:
> (with-open-file (inp-stream input-file)
>            (format outs "From: cbbro...@hex.net~%")
>            (format outs "Reply-to: cbbro...@hex.net~%")
>            (do ((line (read-line inp-stream)
>                       (read-line inp-stream nil 'eof)))
>                        ((eq line 'eof) "Reached end of file.")
>                  (rewrite-line line outs)))

> ... seems as if I need to attach some sort of
> readtable information _somewhere_; I'm not quite clear on where.

Readtables do not affect read-line.  Your problem is not with that.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Nov 10 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.net>
Date: 2000/11/10
Subject: Re: Read-line strangeness
* Christopher Browne
| By looking at a backtrace, I can see that what it's "freaking at" is
| that it's reading a line with a name that contains a "funny
| international accent," which presumably isn't fitting well into
| ISO-8859-1.

  Windows' apostrophes are usually taken from the typographic are of
  Unicode and mapped into high control area (0x80-0x9F) just to screw
  with people who like the ISO 8859-1 standard.

| Now, I had been _thinking_ that all this readtable stuff that has been
| causing such bluster was pretty irrelevant to me, and that I could,
| for the time being, just ignore it from a practical perspective.  

  It has nothing to do with readtables, ut everything to do with
  external-format processing.

| It now seems otherwise; it seems as if I need to attach some sort of
| readtable information _somewhere_; I'm not quite clear on where.

  See your system documentation on the available and default external-
  format settings to open (and friends).

#:Erik
--
 Al-Gore-ism: a procedure for solving an electoral problem in a finite
 number of steps that frequently involves repetition of an operation.
 See also algorithm.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Valeriy E. Ushakov  
View profile  
 More options Nov 10 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: "Valeriy E. Ushakov" <u...@ptc.spbu.ru>
Date: 2000/11/10
Subject: Re: Read-line strangeness

cbbro...@hex.net wrote:
> *** - invalid byte #x81 in CHARSET:ISO-8859-1 conversion
> 1. Break NEWS[2]> where

> EVAL frame for form (READ-LINE INS NIL 'EOF)

> By looking at a backtrace, I can see that what it's "freaking at" is
> that it's reading a line with a name that contains a "funny
> international accent," which presumably isn't fitting well into
> ISO-8859-1.

Set either :EXTERNAL-FORMAT argument or LISP:*DEFAULT-FILE-ENCODING*
to (make-encoding :charset CHARSET:CP1252 :line-terminator :DOS), or
whatever is relevant in your case (no pun intended ;-).

SY, Uwe
--
u...@ptc.spbu.ru                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »