From: Thien-Thi Nguyen <ttn@gnuvola.org>
To: guile-user@gnu.org
Subject: Re: survey: string external representation
Date: Sun, 05 Feb 2012 10:32:13 +0100 [thread overview]
Message-ID: <87d39td3s2.fsf@gnuvola.org> (raw)
In-Reply-To: <87k44dbfu5.fsf@gnuvola.org> (Thien-Thi Nguyen's message of "Fri, 27 Jan 2012 11:27:30 +0100")
[-- Attachment #1: Type: text/plain, Size: 343 bytes --]
() Thien-Thi Nguyen <ttn@gnuvola.org>
() Fri, 27 Jan 2012 11:27:30 +0100
The code assumes Guile 2 DTRT [...]
Well, further investigation raises new doubts. The issue really
is in contiguous mixed raw and \x-escaped octets, and not just
single byte external representation, so here is a followup
experiment that addresses that directly:
[-- Attachment #2: xrep2.scm --]
[-- Type: text/x-scheme, Size: 558 bytes --]
(setlocale LC_ALL "")
(define (hmm symbol)
(define (show x)
(display x) (display "\t") (write x) (newline))
(newline)
(show symbol)
(let ((string (symbol->string symbol)))
(show string)
(show (object->string string))))
(display "LANG: ") (write (getenv "LANG")) (newline)
(hmm 'foo)
(hmm '#{f\"o b\\r}#)
(hmm '⌬) ; U+232C (utf-8: E2 8C AC)
(hmm '䕫) ; U+2F9B2 (utf-8: F0 AF A6 B2)
(hmm '蜨) ; U+2F9BC (utf-8: F0 AF A6 BC)
[-- Attachment #3: Type: text/plain, Size: 150 bytes --]
Below are the output of two runs:
guile -s xrep2.scm \
| tee xrep2-$(guile --version | sed 's/.* //;q')-$LANG.out
What do other people see?
[-- Attachment #4: xrep2-1.4.1.124-it_IT.UTF-8.out --]
[-- Type: text/plain, Size: 276 bytes --]
LANG: "it_IT.UTF-8"
foo foo
foo "foo"
"foo" "\"foo\""
#{f\"o\ b\\r}# #{f\"o\ b\\r}#
f"o b\r "f\"o b\\r"
"f\"o b\\r" "\"f\\\"o b\\\\r\""
⌬ ⌬
⌬ "⌬"
"⌬" "\"⌬\""
䕫 䕫
䕫 "䕫"
"䕫" "\"䕫\""
蜨 蜨
蜨 "蜨"
"蜨" "\"蜨\""
[-- Attachment #5: xrep2-1.8.7-it_IT.UTF-8.out --]
[-- Type: text/plain, Size: 316 bytes --]
LANG: "it_IT.UTF-8"
foo foo
foo "foo"
"foo" "\"foo\""
#{\f\\\"o\ b\\\\r}# #{\f\\\"o\ b\\\\r}#
f\"o b\\r "f\\\"o b\\\\r"
"f\\\"o b\\\\r" "\"f\\\\\\\"o b\\\\\\\\r\""
âÐ âÐ
âÐ "â\x8c¬"
"â\x8c¬" "\"â\\x8c¬\""
䕫 䕫
䕫 "䕫"
"䕫" "\"䕫\""
蜨 蜨
蜨 "蜨"
"蜨" "\"蜨\""
next prev parent reply other threads:[~2012-02-05 9:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-26 8:00 survey: string external representation Thien-Thi Nguyen
2012-01-26 8:38 ` Andy Wingo
2012-01-26 14:11 ` Mike Gran
2012-01-27 10:27 ` Thien-Thi Nguyen
2012-02-05 9:32 ` Thien-Thi Nguyen [this message]
2012-02-07 8:58 ` Andy Wingo
2012-02-07 9:52 ` David Pirotte
2012-01-27 15:32 ` David Pirotte
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d39td3s2.fsf@gnuvola.org \
--to=ttn@gnuvola.org \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).