On Fri, 29 Sep 2006 17:25:39 -0400, "Jonathon McKitrick" jmckitrick@gmail.com wrote:
I added that to the example code above, but when I get the backtrace, you can see that EXTERNAL-FORMAT was LATIN-1, even though in 'create-template-printer' the same keyword arg is UTF-8, UNICODE, or whatever other value I pass in.
No, I can't see it, because I didn't see a backtrace yet.
Did you make sure that after changing the external format the template was really read again, i.e. did you clear the template cache?
Besides, my /guess/ is that the error is signaled when you're writing to the Araneida stream - something one could probably see in the backtrace. Try to create a test case without Araneida, so you can be sure it doesn't affect the result.
On 9/29/06, Edi Weitz edi@agharta.de wrote:
No, I can't see it, because I didn't see a backtrace yet.
encoding error on stream #<SB-SYS:FD-STREAM for "a constant string" {128ACFB1}> (:EXTERNAL-FORMAT :LATIN-1): the character with code 8226 cannot be encoded. [Condition of type SB-INT:STREAM-ENCODING-ERROR]
Restarts: 0: [OUTPUT-NOTHING] Skip output of this character. 1: [ABORT-RESPONSE] Abort this response and answer another request 2: [ABORT] Exit debugger, returning to top level.
Backtrace: 0: (SB-INT:STREAM-ENCODING-ERROR #<SB-SYS:FD-STREAM for "a constant string" {128ACFB1}> 8226) 1: (SB-IMPL::STREAM-ENCODING-ERROR-AND-HANDLE #<SB-SYS:FD-STREAM for "a constant string" {128ACFB1}> 8226) 2: (SB-IMPL::OUTPUT-BYTES/LATIN-1 #<SB-SYS:FD-STREAM for "a constant string" {128ACFB1}> "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">
--- html snipped ---
<div class="comment"> Copyright (c) 2006 Reed Larkey Group Inc. • Website designed by <a href="http://www.bartosz.co.nr/%5C%22%3EBartosz Brzezinski</a> </div>
</div><!-- container --> </body>
</html> " #<SB-SYS:FD-STREAM for "a constant string" {128ACFB1}> :START 0 :END NIL) 6: ((LAMBDA (VALUES)) NIL) 7: ((SB-PCL::FAST-METHOD HTML-TEMPLATE:FILL-AND-PRINT-TEMPLATE (PATHNAME T)) #<unavailable argument> #<unavailable argument> #P"web/am01/index.html" NIL (:STREAM #<SB-SYS:FD-STREAM for "a constant string" {128ACFB1}>)) 8: ((SB-PCL::FAST-METHOD ARANEIDA:HANDLE-REQUEST-RESPONSE (AJAX::MY-RLG-HANDLER (EQL :GET) T)) #<unavailable argument> #S(SB-PCL::FAST-METHOD-CALL :FUNCTION #<FUNCTION (SB-PCL::FAST-METHOD ARANEIDA:HANDLE-REQUEST-RESPONSE #)> :PV-CELL NIL :NEXT-METHOD-CALL #S(SB-PCL::FAST-METHOD-CALL :FUNCTION #<FUNCTION #> :PV-CELL NIL :NEXT-METHOD-CALL NIL :ARG-INFO (3)) :ARG-INFO (3)) #<AJAX::MY-RLG-HANDLER {118FD119}> :GET #ARANEIDA:REQUEST {128B3491}) 9: ((SB-PCL::FAST-METHOD ARANEIDA:HANDLE-REQUEST (ARANEIDA:HANDLER T)) #<unavailable argument> #<unavailable argument> #<AJAX::MY-RLG-HANDLER {118FD119}> #<ARANEIDA:REQUEST {128B3491}>) 10: ((SB-PCL::FAST-METHOD ARANEIDA:HANDLE-REQUEST (ARANEIDA:HANDLER T)) #<unavailable argument> #<unavailable argument> #<ARANEIDA::ROOT-HANDLER {1253EE21}> #<ARANEIDA:REQUEST {128B3491}>) 11: ((LABELS ARANEIDA::DO-IT) #ARANEIDA:SERVE-EVENT-HTTP-LISTENER {1185C8A1} #<SB-SYS:FD-STREAM for "a constant string" {128ACFB1}>) 12: (ARANEIDA::SERVE-EVENT-HTTP-LISTENER-ACCEPT-ONE-REQUEST #<ARANEIDA:SERVE-EVENT-HTTP-LISTENER {1185C8A1}>) 13: (SB-IMPL::SUB-SERVE-EVENT NIL 0) 14: (SB-SYS:WAIT-UNTIL-FD-USABLE 0 :INPUT NIL) 15: (SB-IMPL::REFILL-BUFFER/FD #<SB-SYS:FD-STREAM for "standard input" {121E2489}>) 16: (SB-IMPL::INPUT-CHAR/UTF-8 #<SB-SYS:FD-STREAM for "standard input" {121E2489}> NIL #:EOF-OBJECT) 17: (READ-CHAR #<SB-SYS:FD-STREAM for "standard input" {121E2489}> NIL #:EOF-OBJECT #<unused argument>) 18: (READ-CHAR #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDIN* {100C9D21}> NIL #:EOF-OBJECT #<unused argument>) 19: (READ-PRESERVING-WHITESPACE #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDIN* {100C9D21}> NIL (NIL) T) 20: (READ-PRESERVING-WHITESPACE #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDIN* {100C9D21}> NIL (NIL) NIL) 21: (READ #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDIN* {100C9D21}> NIL (NIL) NIL) 22: (SB-IMPL::REPL-READ-FORM-FUN #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDIN* {100C9D21}> #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDOUT* {10122229}>) 23: (SB-IMPL::REPL-FUN NIL) 24: ((LAMBDA NIL)) 25: ((LAMBDA NIL)) 26: (SB-IMPL::%WITH-REBOUND-IO-SYNTAX #<CLOSURE (LAMBDA NIL) {12101C9D}>) 27: (SB-IMPL::TOPLEVEL-REPL NIL) 28: (SB-IMPL::TOPLEVEL-INIT) 29: ((LABELS SB-IMPL::RESTART-LISP))
Besides, my /guess/ is that the error is signaled when you're writing to the Araneida stream - something one could probably see in the backtrace. Try to create a test case without Araneida, so you can be sure it doesn't affect the result.
Without araneida, the text of the file, including the special characters, prints ok to the slime output buffer, which is in utf-8 encoding. If that matters.
On Fri, 29 Sep 2006 19:03:20 -0400, "Jonathon McKitrick" jmckitrick@gmail.com wrote:
encoding error on stream #<SB-SYS:FD-STREAM for "a constant string" {128ACFB1}>
This is the stream the error was signaled for.
7: ((SB-PCL::FAST-METHOD HTML-TEMPLATE:FILL-AND-PRINT-TEMPLATE (PATHNAME T)) #<unavailable argument> #<unavailable argument> #P"web/am01/index.html" NIL (:STREAM #<SB-SYS:FD-STREAM for "a constant string" {128ACFB1}>))
This is the (Araneida) stream you gave as the STREAM keyword argument to FILL-AND-PRINT-TEMPLATE. They're obviously identical. So, you'll have to specify a fitting external format in Araneida. (Don't know how to do that.)
Without araneida, the text of the file, including the special characters, prints ok to the slime output buffer, which is in utf-8 encoding. If that matters.
It confirms my guess that HTML-TEMPLATE has nothing to do with this problem.
Cheers, Edi.
On 9/29/06, Edi Weitz edi@agharta.de wrote:
It confirms my guess that HTML-TEMPLATE has nothing to do with this problem.
Well, at least that narrows it down, thanks. The only reason I suspected html-template, is because araneida serves the exact same page without any problem when it is served as a regular static file. It must handle the cases differently.
html-template-devel@common-lisp.net