Bug#481115: justify plug-in don't work with 2-byte's UTF-8 texts.

2008-05-29 Thread Dmitry E. Oboukhov
On 19:14 Wed 28 May , James Vega wrote:
 On Tue, May 13, 2008 at 11:20:17PM +0400, Dmitry E. Oboukhov wrote:
 It's evidently that plug-in compute words and strings length
 wrong.The  most  probability  is  that  plug-in   compute
 words/strings  lengthin   bytes   but   not   in   chars.

 Correct.  The vimscript function strlen() simply returns the number of
 bytes.  There are various workarounds but they don't apply to all
 different encodings.  If you could send an example file, I'll test the
 workaround that should be applicable in most cases.

example russian text (utf8):

однажды в студеную зимнюю пору я из лесу вышел был сильный мороз гляжу
поднимается медленно в гору лошадка везущая хворосту воз откуда дровишки
ступай себе мимо... или вот это: царь с царицею простился в путь-дорогу
снарядился и царица у окна стала ждать его одна. ждет пождет с утра до
ночи смотрит в поле инда очи разболелись глядючи с белой зори до ночи не
видать милого друга смотрит в поле вьется вьюга снег ложится на поля вся
белешенька земля... девять месяцев проходит с поля глаз она не сводит
вот в сочельник в самый в ночь бог дает царице дочь... рано утром гость
желанный день и ночь так долгожданный издалече наконец воротился
царь-отец на него она взглянула тяжелехонько вздохнула восхищенья не
снесла и к обедне умерла.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#481115: justify plug-in don't work with 2-byte's UTF-8 texts.

2008-05-28 Thread James Vega
On Tue, May 13, 2008 at 11:20:17PM +0400, Dmitry E. Oboukhov wrote:
 It's evidently that plug-in compute words and strings length
 wrong. The  most  probability  is  that  plug-in   compute
 words/strings  length in   bytes   but   not   in   chars.

Correct.  The vimscript function strlen() simply returns the number of
bytes.  There are various workarounds but they don't apply to all
different encodings.  If you could send an example file, I'll test the
workaround that should be applicable in most cases.

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega [EMAIL PROTECTED]


signature.asc
Description: Digital signature


Bug#481115: justify plug-in don't work with 2-byte's UTF-8 texts.

2008-05-13 Thread Dmitry E. Oboukhov

Package: vim-runtime
Version: 1:7.1.293
Severity: important
Tags: l10n

There is no result with pressing  keys  _j  with  using  the
justify plug-in  for  aligning  for  example  Russian  text.

My investigation shows that if page width (tw) set to  value
50 (N) and press _j for Russian  text  with  string  lengths
less than 25 (N/2) then some  spaces  appears  between  some
words i.e. plug-in tries to align text.

It's evidently that plug-in compute words and strings length
wrong.   The  most  probability  is  that  plug-in   compute
words/strings  length   in   bytes   but   not   in   chars.
(1 Russian char takes 2 bytes in UTF-8) And because of  this
plug-in thinks that strings with length more than  25  (N)
chars are more long then setting tw=50 (2*N) and  skip  such
strings.




signature.asc
Description: Digital signature