[geany/geany] 6e8e0c: Fix display of non-ASCII tags in the symbols tree for non-UTF-8 files
Colomban Wendling
git-noreply at geany.org
Thu Oct 18 14:55:33 UTC 2012
Branch: refs/heads/master
Author: Colomban Wendling <ban at herbesfolles.org>
Committer: Colomban Wendling <ban at herbesfolles.org>
Date: Thu, 18 Oct 2012 14:55:33
Commit: 6e8e0c7bfb6597cbfbf6e5dbfa2cb9a356146c49
https://github.com/geany/geany/commit/6e8e0c7bfb6597cbfbf6e5dbfa2cb9a356146c49
Log Message:
-----------
Fix display of non-ASCII tags in the symbols tree for non-UTF-8 files
We used to convert the tags from the file encoding to UTF-8, but since
we parse directly from our UTF-8 buffer, all tags are UTF-8, which lead
to an improper conversion.
Modified Paths:
--------------
src/symbols.c
Modified: src/symbols.c
3 files changed, 3 insertions(+), 0 deletions(-)
===================================================================
@@ -1028,6 +1028,9 @@ static const gchar *get_symbol_name(GeanyDocument *doc, const TMTag *tag, gboole
if (utils_str_equal(doc->encoding, "UTF-8") ||
utils_str_equal(doc->encoding, "None"))
doc_is_utf8 = TRUE;
+ else /* normally the tags will always be in UTF-8 since we parse from our buffer, but a
+ * plugin might have called tm_source_file_update(), so check to be sure */
+ doc_is_utf8 = g_utf8_validate(tag->name, -1, NULL);
if (! doc_is_utf8)
utf8_name = encodings_convert_to_utf8_from_charset(tag->name,
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
More information about the Commits
mailing list