Re: fconfigure -translation binary conversion
- From: yahalom <yahalome@xxxxxxxxx>
- Date: Thu, 28 Feb 2008 06:14:35 -0800 (PST)
On Feb 28, 9:31 pm, Andreas Leitgeb <a...@xxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
yahalom <yahal...@xxxxxxxxx> wrote:
I understand (or think I do :-)) but I am looking for a way out of
this mess. again my problem is that in tclhttpd code there is this
fconfigure. and I do not want to do in my code any utf-8 conversions
(unless this is the only way to work utf-8).
Now, *I* do not understand:
does it work *with* encoding convertto utf-8
does it work *without* encoding convertto utf-8
if it was working I was not asking :-). the xml is proper for explorer
if I do the "endcoding convertto". but if in the xml I return, there
are result from the dabtabase they are not seen correctly (because I
did the conversion). also what I see in "puts stderr" (which helps
debugging) is not proper if I do the encoding. so in general either
way some things work and some fail. I want all too work smooth - xml
in a proper utf-8 format, result seen and debugging info seen...
I'd assume that one of them would work, so where is the
problem with taking whatever works?
PS: for further diagnosis, do the following:
puts [string length $utf8Str]
(right after you got the value from DB)
If the length corresponds to the number of (hebrew)
characters, then you actually have a tcl-internal formatted
string, and you need one step of conversion: either through
encoding, or by *not* setting the channel to binary.
If the reported length is somewhat larger, then you probably
already have a utf-8 encoded string, and you can throw it
directly to a binary channel.
thanks for this tip. I will try it. It sounds strange that string
length will be bigger number then the actual letters but if this is
the way it works....
sorry for hard pressing on this staff but all this encoding really
gets me crazy. it looks like nothing sticks, as though you have pieces
that needs different treatment and tcl with all it simplicity makes it
complex. in the beggining I thought utf-8 should be natuaral to tcl as
utf-8 is how tcl represent internally strings (at least that is what I
was told). but now I feel very shaky with all these conversions. as
though you never know what are your strings. it is like "what you see
is not what you get". maybe I am wrong in thinking that this should be
simple - tell tcl that the os works utf-8, write your code in utf-8
keep data in the database in utf-8 and all will be utf-8.
.
- Follow-Ups:
- Re: fconfigure -translation binary conversion
- From: Andreas Leitgeb
- Re: fconfigure -translation binary conversion
- References:
- fconfigure -translation binary conversion
- From: yahalom
- Re: fconfigure -translation binary conversion
- From: yahalom
- Re: fconfigure -translation binary conversion
- From: Andreas Leitgeb
- Re: fconfigure -translation binary conversion
- From: yahalom
- Re: fconfigure -translation binary conversion
- From: Andreas Leitgeb
- Re: fconfigure -translation binary conversion
- From: yahalom
- Re: fconfigure -translation binary conversion
- From: Andreas Leitgeb
- fconfigure -translation binary conversion
- Prev by Date: Re: Help with sockets in block mode, please
- Next by Date: Re: Problems with Expect
- Previous by thread: Re: fconfigure -translation binary conversion
- Next by thread: Re: fconfigure -translation binary conversion
- Index(es):
Relevant Pages
|