Re: Reading files in tcl that are unicode encoded
From: Kiran Madabhushi (maskiran_at_yahoo.com)
Date: 05/20/04
- Next message: Cameron Laird: "Re: ftp with tcl"
- Previous message: Dossy: "Re: [array values] -- could someone TIP this, please? :-)"
- In reply to: Michael Schlenker: "Re: Reading files in tcl that are unicode encoded"
- Next in thread: Benjamin Riefenstahl: "Re: Reading files in tcl that are unicode encoded"
- Reply: Benjamin Riefenstahl: "Re: Reading files in tcl that are unicode encoded"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 20 May 2004 04:44:13 -0700
Michael Schlenker <schlenk@uni-oldenburg.de> wrote in message news:<2gugmlF6uvb2U1@uni-berlin.de>...
> Kiran Madabhushi wrote:
> > Hi,
> > I saved a txt file from notepad in UTF-8 format (or unicode format, as
> > these are the 2 options I have in windows notepad). I started a Wish
> > shell in windows and when I do a glob *.txt, the file name is show in
> > unicode encoded characters (even the file name is saved as unicode
> > format). I want to display this file in wish text box so that it
> > appears same as that in Notepad. Can I do that in Wish. If not what
> > else has to be done to show this file n text box. I assume that if
> > this can be shown in text box, the same holds for entry.
> >
>
> This should work, could stumble over the byte order markers Notepad
> places in error
> (http://sourceforge.net/tracker/index.php?func=detail&aid=800114&group_id=10894&atid=110894
> )
>
> package require Tk
> set file [tk_getOpenFile]
> set fd [open $file]
> fconfigure $fd -encoding utf-8
> set text [read $fd]
> close $fd
> text .t -width 80
> pack .t
> .t insert end $text
>
> Michael
Thanks Michael, this helped me. Now I have q more question. How do I
type characters so that they are shown in unicode glyph. e.g. I set
the input language on my WinXP to be something other than English.
When I do something in Notepad, it shows in the respective font. But
if i do the same thing in TCL Entry / text box, only question marks
are shown. I want the characters in Entry boxes also to be same as
those shown in notepad
Thanks
Kiran
- Next message: Cameron Laird: "Re: ftp with tcl"
- Previous message: Dossy: "Re: [array values] -- could someone TIP this, please? :-)"
- In reply to: Michael Schlenker: "Re: Reading files in tcl that are unicode encoded"
- Next in thread: Benjamin Riefenstahl: "Re: Reading files in tcl that are unicode encoded"
- Reply: Benjamin Riefenstahl: "Re: Reading files in tcl that are unicode encoded"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|