geany
1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
![]() ![]() |
Encoding conversion and Byte Order Mark (BOM) handling. More...
#include "gtkcompat.h"
Go to the source code of this file.
Functions | |
gchar * | encodings_convert_to_utf8 (const gchar *buffer, gssize size, gchar **used_encoding) |
Tries to convert buffer into UTF-8 encoding and store the detected original encoding in used_encoding. More... | |
gchar * | encodings_convert_to_utf8_from_charset (const gchar *buffer, gssize size, const gchar *charset, gboolean fast) |
Tries to convert buffer into UTF-8 encoding from the encoding specified with charset. More... | |
const gchar * | encodings_get_charset_from_index (gint idx) |
Gets the character set name of the specified index e.g. More... | |
Encoding conversion and Byte Order Mark (BOM) handling.
Definition in file encodings.h.
enum GeanyEncodingIndex |
List of known and supported encodings.
Definition at line 49 of file encodings.h.
gchar * encodings_convert_to_utf8 | ( | const gchar * | buffer, |
gssize | size, | ||
gchar ** | used_encoding | ||
) |
Tries to convert buffer into UTF-8 encoding and store the detected original encoding in used_encoding.
buffer | the input string to convert. |
size | the length of the string, or -1 if the string is nul-terminated. |
used_encoding | (out) return location of the detected encoding of the input string, or NULL . |
g_free()
. Otherwise NULL
. Definition at line 784 of file encodings.c.
References encodings_check_regexes(), and encodings_convert_to_utf8_with_suggestion().
gchar * encodings_convert_to_utf8_from_charset | ( | const gchar * | buffer, |
gssize | size, | ||
const gchar * | charset, | ||
gboolean | fast | ||
) |
Tries to convert buffer into UTF-8 encoding from the encoding specified with charset.
If fast is not set, additional checks to validate the converted string are performed.
buffer | The input string to convert. |
size | The length of the string, or -1 if the string is nul-terminated. |
charset | The charset to be used for conversion. |
fast | TRUE to only convert the input and skip extended checks on the converted string. |
g_free()
. Otherwise NULL
. Definition at line 625 of file encodings.c.
References geany_debug(), and NULL.
Referenced by encodings_convert_to_utf8_with_suggestion(), get_symbol_name(), get_symbol_tooltip(), handle_encoding(), and handle_forced_encoding().
const gchar * encodings_get_charset_from_index | ( | gint | idx | ) |
Gets the character set name of the specified index e.g.
for use with document_set_encoding().
idx | GeanyEncodingIndex to retrieve the corresponding character set. |
NULL
if the index is invalid.Definition at line 267 of file encodings.c.
References GeanyEncoding::charset, encodings, GEANY_ENCODINGS_MAX, and NULL.
Referenced by on_find_in_files_dialog_response(), and open_session_file().