Re: I'm looking for a method of converting a string's character encoding

2012-04-27 Thread Sunjoong Lee
Are file-port and string-port much different? I can convert strings in file but I want not to use file. My terminal charset is utf-8. Suppose there be a "XXX" encoded text file "a.txt", it would be converted like this: (use-modules (ice-9 rdelim)) (set-port-encoding! (current-output-port) "utf-8")

Re: crash in guile-sqlite3

2012-04-27 Thread David Pirotte
hello, > ... >(stmt (sqlite-prepare db "INSERT INTO foos(name) VALUES(?);"))) i'd rather bind the statment in scheme _anyway_ if i was you. david ;; -- (use-modules (sqlite3)) (define db (sqlite-open "ex0.db")) (define (sqlite/command db command) (let ((stmt (sqlite-prepare db comm

Re: crash in guile-sqlite3

2012-04-27 Thread David Pirotte
Hi, > I mean a example code of Joonas Sarajärvi, > http://paste.pocoo.org/show/587676/ , produces a Segmentation fault on > Guile 2.0.5 too. I though what if a integer. In the integer case, there is > no Segmentation fault. Here is a diff of my test code from Joonas's: the paste seems unavalaibl

I'm looking for a method of converting a string's character encoding

2012-04-27 Thread Sunjoong Lee
Hello, I'm looking for a method of converting a string's character encoding from a certain codeset to utf-8. I know the string of Guile uses utf-8 and (read (open-bytevector-input-port (string->utf8 "hello"))) returns "hello" . But what if the string "hello" be encoded not utf-8 and you want to ge

Re: crash in guile-sqlite3

2012-04-27 Thread Sunjoong Lee
Hi, David; 2012/4/28 David Pirotte > > Best would be to send us an small, complete and concise example of you > consider > reproducible, could you d that ? > I mean a example code of Joonas Sarajärvi, http://paste.pocoo.org/show/587676/ , produces a Segmentation fault on Guile 2.0.5 too. I thoug

Re: crash in guile-sqlite3

2012-04-27 Thread David Pirotte
Hi, > > I tried to run guile in gdb to get a backtrace from the crash. The > > segfault seems to be triggered inside libsqlite3 code, but I could not > > ... > Same crash on Guile 2.0.5. It looks like string encoding problem. Suppose > name be an integer not a string like 10, it would not crash.

Re: A question about http-get of (web client)

2012-04-27 Thread Sunjoong Lee
I think I found the cause of the error; the error was in declare-uri-header! That was not a encoding problem. http://www.gnu.org/home.html will send Content-Location header and it is home.en.html if your Accept-Language is en-US. Yes!! This is a relativeURI. Location is absolute URI but Content-L

Re: read-response-body of (web response) depends on Content-Length but ...

2012-04-27 Thread Sunjoong Lee
I cancel a previous patch because Ian Price solve it nice. Daniel Hartwig told me that; thanks Daniel. I cannot solve http://lists.gnu.org/archive/html/guile-user/2012-04/msg00034.html yet but can solve http://lists.gnu.org/archive/html/guile-user/2012-04/msg00041.htmlwith Ian's solution, http://l

Re: read-response-body of (web response) depends on Content-Length but ...

2012-04-27 Thread Daniel Hartwig
On 27 April 2012 16:28, Sunjoong Lee wrote: > I googled and found http://tools.ietf.org/html/rfc2616 . > > In a section of "4.4 Message Length": >   2.If a Transfer-Encoding header field (section 14.41) is present and >      has any value other than "identity", then the transfer-length is >      d

Re: read-response-body of (web response) depends on Content-Length but ...

2012-04-27 Thread Sunjoong Lee
The urgent patch posted before makes a bug, so I cancel it and repost: ## cut here ## --- /usr/share/guile/2.0/web/response.scm 2012-04-22 04:36:06.753878689 +0900 +++ response.scm 2012-04-27 19:54:55.539304271 +0900 @@ -217,13 +217,16 @@ (define (read-response-body r) "Reads th

Re: read-response-body of (web response) depends on Content-Length but ...

2012-04-27 Thread Sunjoong Lee
Below is a urgent patch of response.scm: --- /usr/share/guile/2.0/web/response.scm 2012-04-22 04:36:06.753878689 +0900 +++ response.scm 2012-04-27 18:49:16.499881816 +0900 @@ -217,13 +217,16 @@ (define (read-response-body r) "Reads the response body from @var{r}, as a bytevector. Returns @co

Re: read-response-body of (web response) depends on Content-Length but ...

2012-04-27 Thread Sunjoong Lee
I googled and found http://tools.ietf.org/html/rfc2616 . In a section of "4.4 Message Length": 2.If a Transfer-Encoding header field (section 14.41) is present and has any value other than "identity", then the transfer-length is defined by use of the "chunked" transfer-coding (section

read-response-body of (web response) depends on Content-Length but ...

2012-04-27 Thread Sunjoong Lee
Hello, I cannot solve http://lists.gnu.org/archive/html/guile-user/2012-04/msg00034.html yet. This is a potentially related problem but I'm not sure; (use-modules ((srfi srfi-11) #:select (let-values)) ((web uri) #:select (string->uri)) ((web client) #:select (htt