NetSurf
Functions | Variables
utf8.c File Reference
#include "amiga/os3support.h"
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <proto/codesets.h>
#include <proto/exec.h>
#include <proto/utility.h>
#include "utils/nsoption.h"
#include "utils/utf8.h"
#include "netsurf/utf8.h"
#include "amiga/utf8.h"
Include dependency graph for utf8.c:

Go to the source code of this file.

Functions

static nserror ami_utf8_codesets (const char *string, size_t len, char **result, bool to_local)
 
nserror utf8_from_local_encoding (const char *string, size_t len, char **result)
 
nserror utf8_to_local_encoding (const char *string, size_t len, char **result)
 
void ami_utf8_free (char *ptr)
 
char * ami_utf8_easy (const char *string)
 
char * ami_to_utf8_easy (const char *string)
 

Variables

static struct gui_utf8_table utf8_table
 
struct gui_utf8_tableamiga_utf8_table = &utf8_table
 

Function Documentation

◆ ami_to_utf8_easy()

char * ami_to_utf8_easy ( const char *  string)

Definition at line 119 of file utf8.c.

References NSERROR_OK, and utf8_from_local_encoding().

Referenced by ami_gui_event(), and ami_gui_opts_use().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_utf8_codesets()

static nserror ami_utf8_codesets ( const char *  string,
size_t  len,
char **  result,
bool  to_local 
)
static

Definition at line 35 of file utf8.c.

References NSERROR_BAD_ENCODING, NSERROR_OK, nsoption_int, and result.

Referenced by utf8_from_local_encoding(), and utf8_to_local_encoding().

Here is the caller graph for this function:

◆ ami_utf8_easy()

char * ami_utf8_easy ( const char *  string)

Definition at line 109 of file utf8.c.

References NSERROR_OK, and utf8_to_local_encoding().

Referenced by ami_cookies_present(), ami_drag_selection(), ami_font_scan_gui_open(), ami_gui_opts_open(), ami_gui_opts_setup(), ami_history_global_present(), ami_history_local_present(), ami_hotlist_present(), ami_menu_alloc_item(), ami_pageinfo_open(), ami_print_ui_setup(), ami_quit_netsurf_delayed(), ami_search_open(), amiga_warn_user(), amiga_warn_user_multi(), gui_download_window_create(), gui_window_create(), gui_window_set_status(), gui_window_set_title(), gui_window_set_url(), HOOKF(), and translate_escape_chars().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_utf8_free()

void ami_utf8_free ( char *  ptr)

◆ utf8_from_local_encoding()

nserror utf8_from_local_encoding ( const char *  string,
size_t  len,
char **  result 
)

Definition at line 80 of file utf8.c.

References ami_utf8_codesets(), nsoption_charp, result, and utf8_from_enc().

Referenced by ami_clipboard_cat_collection(), ami_gui_hotlist_add(), ami_key_to_nskey(), ami_to_utf8_easy(), on_file_dropped(), ro_gui_selection_prepare_paste_dataload(), ro_gui_url_bar_get_url(), ro_gui_window_import_text(), and toolbar_key_input().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ utf8_to_local_encoding()

nserror utf8_to_local_encoding ( const char *  string,
size_t  len,
char **  result 
)

Definition at line 89 of file utf8.c.

References ami_utf8_codesets(), ASPrintf(), NSERROR_NOMEM, nsoption_charp, result, and utf8_to_enc().

Referenced by ami_utf8_easy(), amiga_bm_nsfont_position_in_string(), amiga_bm_nsfont_split(), amiga_bm_nsfont_text(), amiga_bm_nsfont_width(), gui_download_window_create(), gui_get_clipboard(), gui_set_clipboard(), gui_window_set_title(), query_user_xy(), ro_gui_download_update_status(), ro_gui_interactive_help_broadcast(), ro_gui_menu_translate(), ro_gui_save_clipboard(), ro_gui_save_drag_end(), ro_gui_save_set_state(), ro_gui_set_icon_string(), ro_gui_set_window_title(), ro_gui_url_bar_set_url(), and ro_gui_window_prepare_form_select_menu().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ amiga_utf8_table

struct gui_utf8_table* amiga_utf8_table = &utf8_table

Definition at line 136 of file utf8.c.

Referenced by main().

◆ utf8_table

struct gui_utf8_table utf8_table
static
Initial value:
= {
.utf8_to_local = utf8_to_local_encoding,
.local_to_utf8 = utf8_from_local_encoding,
}
nserror utf8_to_local_encoding(const char *string, size_t len, char **result)
Definition: utf8.c:89
nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
Definition: utf8.c:80

Definition at line 131 of file utf8.c.