Mix ascii and utf-8 in one text file

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

Mix ascii and utf-8 in one text file

#1 Post by don570 »

I have written an example to show how easy it is
to add some utf-8 text to some ascii text and produce a file.

UTF-8 allows more diverse characters so it is good for math formulas.
ascii text is good for gettext translation. So a mixture of
the two types is useful. The ascii text is part of the script whereas
the utf-8 text is a separate file stored in /root/.config/Mix_text/ .

I wrote the script so that the utf-8 text could be added to the beginning
or end of a line of ascii text.

I put the script in a pet file to make it easy to install.
Launch it from the Start menu

Start Menu > Utility > Mix text

The combined text file is shown. (see image). This file is stored in
/tmp/Mix_text/combined.



Image
.
Attachments
Mix_text-1.0.pet
experiment app
(1.89 KiB) Downloaded 202 times

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#2 Post by don570 »

A practical example of this technique---->

Puppy Units 1.2 has math reference windows .
They are a mixture of ascii and utf-8 characters.

I found that there is a slow down as the combine text file is created
however it's only a second or so.

http://murga-linux.com/puppy/viewtopic.php?t=92152
______________________________________

Post Reply