Tracker: Bugs

5 tagmanager fails on reST files in utf-8 (w/ solution) - ID: 3578050
Last Update: Comment added ( colombanw )

Hi!

I'm using Geany 1.22 on Fedora Linux.

The problem:
reST formatted text containing Non-ASCII characters (e.g. German umlauts)
in section titles isn't properly shown in Geany's "Symbols" window: Those Non-ASCII titles aren't shown at all.

Reason:
The implemented vStringLength(name) counts the bytes and not the characters of the title. In utf-8/16 that may not be the same...
Comparing it to the length of the title adornment (line of underlines) gives wrong results.

Solution (at least for utf-8):
Do not count the utf-8 continuation bytes any longer.

I attached a simple solution by recalculating name_len.

Since I'm not a C-coder that solution might not be perfect, but for me it works.

Christian


Christian Ziemski ( chziemski ) - 2012-10-18 02:52:19 PDT

5

Closed

Fixed

Colomban Wendling

Filetypes

v1.23

Public


Comments ( 2 )

Date: 2012-10-18 08:32:49 PDT
Sender: colombanwProject Admin

I fixed it slightly differently in Git for better handling of non-UTF-8
input, but the idea is the same. Thanks for reporting & investigating
this!

@elextr: no, input isn't always UTF-8. It's UTF-8 if we feed the parser
with a buffer, but not necessarily if we parse the real file (e.g. with
`geany -g`).


Date: 2012-10-18 03:39:12 PDT
Sender: elextr

Since the text being parsed is always UTF-8 your simple solution should
work.




Attached File ( 1 )

Filename Description Download
geany.diff Diff file for tagmanager/rest.c Download

Changes ( 7 )

Field Old Value Date By
resolution_id Accepted 2012-10-18 08:32:49 PDT colombanw
assigned_to nobody 2012-10-18 08:32:49 PDT colombanw
close_date - 2012-10-18 08:32:49 PDT colombanw
status_id Open 2012-10-18 08:32:49 PDT colombanw
artifact_group_id None 2012-10-18 08:32:49 PDT colombanw
resolution_id None 2012-10-18 03:39:12 PDT elextr
File Added 455033: geany.diff 2012-10-18 02:52:28 PDT chziemski