Tiny Core Linux

Tiny Core Extensions => TCE Talk => Extension requests => Topic started by: Fven on March 04, 2020, 04:00:34 AM

Title: TED for TC11.0 (64-bit)
Post by: Fven on March 04, 2020, 04:00:34 AM
Hello,
I saw on the forum that there is a x86 version of TED for TC10 and TC11.0 available. TED Word Processor (http://forum.tinycorelinux.net/index.php/topic,22666.msg141943.html#msg141943). I would like to use this extension. Is it possible to add TED to the 64-bit version of TC11.0?
Title: Re: TED for TC11.0 (64-bit)
Post by: Juanito on March 04, 2020, 04:34:24 AM
posted
Title: Re: TED for TC11.0 (64-bit)
Post by: Fven on March 04, 2020, 09:25:59 AM
Thanks Juanito
Title: Re: TED for TC11.0 (64-bit)
Post by: Fven on March 20, 2020, 12:54:03 PM
Dear Juanito,
There is a problem with the Ted extension. When I save a document, I cannot open it. I compiled Ted with Linux Mint and it works fine. Do you have any idea what causes this. I am learning how to create an extension but I have the same problem.
Title: Re: TED for TC11.0 (64-bit)
Post by: Rich on March 20, 2020, 01:15:33 PM
Hi Fven
... When I save a document, I cannot open it. ...
Do you see any error messages if you open that  document  through a terminal:
Code: [Select]
Ted document
Title: Re: TED for TC11.0 (64-bit)
Post by: Fven on March 20, 2020, 02:13:45 PM
Thanks Rich for your quick response.

When I open test.rtf, Ted doesn't recognize the .rtf file.
Code: [Select]
tc@box:/mnt/sdb1/tce$ Ted test.rtf
textConverter.c(432) tc->tcNativeEncodingName="CP1252" tc->tcIconvFrUtf8=0xffffffffffffffff
docRtfWriteText.c(160) produced=-1
When I save a document I get this error several times.

When I open a document written with Ted I get the following error messages
Code: [Select]
docRtfReadText.c(104) upto=-1
docRtfReadRtf.c(358) len=1
docRtfReadRtf.c(416) len=1
docRtfReadRtf.c(723) controlWord="fcharset" res=-1
docRtfReadRtf.c(560) rval=-1
docRtfReadFontTable.c(215) rcw->rcwWord="f" arg=0
docRtfReadRtf.c(159) rrc->rrCurrentLine=4 rcw->rcwWord="f" arg=0
docRtfReadRtf.c(780) res=-1 controlWord="f"
docRtfReadRtf.c(560) rval=-1
docRtfReadFontTable.c(304) rcw->rcwWord="fonttbl" arg=-1
docRtfReadRtf.c(159) rrc->rrCurrentLine=4 rcw->rcwWord="fonttbl" arg=-1
docRtfReadRtf.c(780) res=-1 controlWord="fonttbl"
docRtfReadRtf.c(560) rval=-1
docRtfRead.c( 66) rcw->rcwWord="rtf" rval=-1
docRtfReadRtf.c(159) rrc->rrCurrentLine=4 rcw->rcwWord="rtf" arg=1
docRtfRead.c(134) 1=1

Ted responds with the message: "File is not in Rich Text Format. Open anyway?"

Code: [Select]
^CtextConverter.c(432) tc->tcNativeEncodingName="CP1252" tc->tcIconvFrUtf8=0xffffffffffffffff
docRtfWriteText.c(160) produced=-1
textConverter.c(432) tc->tcNativeEncodingName="CP1252" tc->tcIconvFrUtf8=0xffffffffffffffff
docRtfWriteText.c(160) produced=-1

Unfortunately I can't show you the text from the screen.
Copy and Paste also doesn't work.
Title: Re: TED for TC11.0 (64-bit)
Post by: Rich on March 20, 2020, 02:31:23 PM
Hi Fven
It appears to be character set related:
Quote
textConverter.c(432) tc->tcNativeEncodingName="CP1252" tc->tcIconvFrUtf8=0xffffffffffffffff
I think  CP1252  is a Windows character set, and  FrUtf8  might refer to a French UTF8 encoding. Maybe you need and extension
that provides CP1252?

Title: Re: TED for TC11.0 (64-bit)
Post by: Fven on March 20, 2020, 02:38:56 PM
Thanks Rich, it will be a challenge
Title: Re: TED for TC11.0 (64-bit)
Post by: Rich on March 20, 2020, 02:40:56 PM
Hi Fven
On second thought, I think the messages is saying it's using the CP1252 character set:
Quote
tc->tcNativeEncodingName="CP1252"

but can't find a French UTF charcter set:
Quote
tc->tcIconvFrUtf8=0xffffffffffffffff

That  0xffffffffffffffff  looks like a bad pointer, or maybe simply an error since 0xffffffffffffffff is hex for -1.
Title: Re: TED for TC11.0 (64-bit)
Post by: Fven on March 20, 2020, 02:51:32 PM
Quote
That 0xffffffffffffffff looks like a bad pointer, or maybe simply an error since 0xffffffffffffffffff is hex for -1.
That is going to be a problem. The programming language C says nothing to me
Title: Re: TED for TC11.0 (64-bit)
Post by: Rich on March 21, 2020, 01:06:09 AM
Hi Fven
I reproduced the problem. Installing  glibc_gconv.tcz  seems to fix it.
Title: Re: TED for TC11.0 (64-bit)
Post by: Rich on March 21, 2020, 01:28:09 AM
Hi Juanito
When I tried  Ted  in TC10 x86 the problem was not reproducing. Turns out I had  mtools  onboot which depends on  glibc_gconv.tcz.
So the TC10 and TC11 x86 dependency files need updating too.
Title: Re: TED for TC11.0 (64-bit)
Post by: Juanito on March 21, 2020, 01:45:38 AM
done - thanks  :)
Title: Re: TED for TC11.0 (64-bit)
Post by: Fven on March 21, 2020, 08:22:00 AM
Hi Rich.
I had never discovered that. How did you find out that an extension was missing?
Title: Re: TED for TC11.0 (64-bit)
Post by: Rich on March 21, 2020, 09:14:05 AM
Hi Fven
I had never discovered that. How did you find out that an extension was missing?
It involved 1 part detective work plus 1 part dumb luck.

I downloaded the source package.
The error message says the error occurred in the file  textConverter.c  at  line 432:
Code: [Select]
textConverter.c(432) tc->tcNativeEncodingName="CP1252" tc->tcIconvFrUtf8=0xffffffffffffffff
Line 432 (SXDEB .... ) which prints the error message occurred because  tc->tcIconvFrUtf8  equaled  -1 (0xffffffffffffffff):
Code: [Select]
    if  ( (iconv_t)tc->tcIconvFrUtf8 == (iconv_t)-1 )
{
SXDEB(tc->tcNativeEncodingName,tc->tcIconvFrUtf8);
return -1;

Looking further up in the file to see where  tc->tcIconvFrUtf8  gets set to  -1  (line 402) I find:
Code: [Select]
    tc->tcIconvFrUtf8= (struct TextConverterImpl *)
    iconv_open( tc->tcNativeEncodingName, "UTF-8" );

Reading the man file for  iconv_open  to see what this function does, I noticed it says running:
Code: [Select]
iconv --listwill tell you what character sets are available. I checked to see which extension provided  iconv, it was  glibc_apps.tcz. But that
didn't fix the problem.

Here comes the dumb luck part. I noticed the  glibc_gconv.tcz  which contained a bunch of character conversion libraries. So I
tried it and it worked. I then removed  glibc_apps.tcz  to verify it was not required as part of the fix.
Title: Re: TED for TC11.0 (64-bit)
Post by: Fven on March 21, 2020, 12:35:17 PM
Hi Rich
Thanks, I'll try to follow your steps. Last question. You said
Quote
I checked to see which extension provided iconv
How did you do that?
Title: Re: TED for TC11.0 (64-bit)
Post by: Rich on March 21, 2020, 08:14:06 PM
Hi Fven
The  Apps  utility has a dropdown labeled  Search.  Click it and change it to  Provides.  Enter what you are looking for in the text box
to the right of the button, and you will get a list of extensions containing that term.  iconv  returns a lot of results because it matches
on substrings. So it matches on iconv, iconv.h uniconv.h, uniconv-ext.py, etc.
Title: Re: TED for TC11.0 (64-bit)
Post by: Fven on March 22, 2020, 08:07:08 AM
Hi Rich
That's easier than I thought. I appreciate your help.