guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Sunjoong Lee
Subject: Re: I'm looking for a method of converting a string's character encoding
Date: Sun, 29 Apr 2012 01:38:28 +0900

http-get is innocent but I need encoding converter yet.

In front-of my program, after appending a line (set-port-encoding! (current-output-port) "utf-8") , the contents body string of web page displayed well. With with-fluids and %default-port-encoding, I can use html->sxml . But contents of output sxml's codeset is the original web page's. For example, when you want to compare strings, you must use codeset of the web pages's. If you want to compare strings of two web pages, codeset converting method may be need.

2012/4/28 Sunjoong Lee <address@hidden>
Background;
#:decode-body? keyword of http-get seems not to work properly; I should set #:decode-body? to false value and decode the contents body string manually. If a web page's charset be utf-8, there be no problem. If not, a problem occurs. decode-response-body of (web client) call decode-string with web page's charset. But real charset of bytevector is iso-8859-1, not web page's charset. If so, you should not let http-get use decode-response-body.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]