bug-ed
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-ed] [patch] ed treats none UTF-8


From: Takao Fujiwara
Subject: Re: [Bug-ed] [patch] ed treats none UTF-8
Date: Tue, 11 Aug 2009 11:10:16 +0900
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2

Hi,

(08/10/09 19:53), Antonio Diaz Diaz-san wrote:
Sorry, I didn't explain clearly. I meant "while checking your patch I
discovered that the unpatched ed itself does not show correctly (or at
all) control characters on screen". Just try a line with a null byte or
a "carriage return".


I don't understand your problem. When I created either a null byte or '\r' 
file, I could not see any problems.

% od -xc a
0000000    0000
         \0
0000001

% ed-1.4/ed a
Newline appended
1
P
*1

*q

% od -xc b
0000000    000d
         \r
0000001

% tmp/ed-1.4/ed b
Newline appended
2
P
*1

*q

When I see the source code, 'io.c:'read_stream_line() calls set_binary() if the 
file includes '\0'.
I see the set_binary() is called without problems.

Could you explain what is the difference between the original and patched ed?



Some binary files include multi-byte chars and people would like to
show the multi-byte chars in the binary files.

How can a multi-byte char be recognized as such inside a binary file
(arbitrary sequence of bytes)?

E.g. .mo files include the translation strings but it's a binary file.



I can enhance the patch.

It is not a problem with your patch. It is simply that ed is too limited
for what you want it to do.

However ed is a line-oriented text editor.
Many people expect text files need to be handled in the current locale.
This is not a GB18030 only but also several encodings and I think this patch is 
very simple.

Man page doesn't explain it supports C locale only and I think normally 
displaying char is expected in the current locale.
Actually this problem is asked by several people and I'm integrating my patch in my company. So if you could enhance the function, it would be great instead of maintaining by each distributors.

Thanks,
fujiwara


Regards,
Antonio.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]