summaryrefslogtreecommitdiff
path: root/src/fl_encoding_latin1.cxx
blob: 7ec86f14a76f4868d13375c2f1e8ec17b6dfeb0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//
// Convert Windows-1252 (Latin-1) encoded text to the local encoding.
//
// Copyright 1998-2021 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file.  If this
// file is missing or damaged, see the license at:
//
//     https://www.fltk.org/COPYING.php
//
// Please see the following page on how to report bugs and issues:
//
//     https://www.fltk.org/bugs.php
//

#include <config.h>
#include <FL/fl_draw.H>
#include <FL/Fl.H>
#include "Fl_System_Driver.H"
#include <FL/Enumerations.H>
#include <stdlib.h>
#include "flstring.h"

/**
 \cond DriverDev
 \addtogroup DriverDeveloper
 \{
 */

/**
 Default implementation of latin-to-local text conversion.

 The default implementation returns the original text. This method should
 be reimplemented by drivers for platforms that commonly use latin
 text encoding.

 \see fl_latin1_to_local(const char *, int)
 */
const char *Fl_System_Driver::latin1_to_local(const char *t, int)
{
  return t;
}

/**
 Default implementation of local-to-latin text conversion.

 The default implementation returns the original text. This method should
 be reimplemented by drivers for platforms that commonly use latin
 text encoding.

 \see fl_local_to_latin1(const char *, int)
 */
const char *Fl_System_Driver::local_to_latin1(const char *t, int)
{
  return t;
}

/**
 \}
 \endcond
 */

const char *fl_latin1_to_local(const char *t, int n)
{
  return Fl::system_driver()->latin1_to_local(t, n);
}

const char *fl_local_to_latin1(const char *t, int n)
{
  return Fl::system_driver()->local_to_latin1(t, n);
}

// Stub implementations for mac_roman encoding functions.
// On X11/Unix, these are no-ops since mac_roman encoding is not used.

const char *Fl_System_Driver::mac_roman_to_local(const char *t, int)
{
  return t;
}

const char *Fl_System_Driver::local_to_mac_roman(const char *t, int)
{
  return t;
}