Print tab as space.
This commit is contained in:
parent
0db478586e
commit
9bcf4a77ae
17
md380.c
17
md380.c
@ -307,23 +307,6 @@ static void setup_zone(int zone_index, int chan_index)
|
||||
*data |= 1 << (chan_index & 7);
|
||||
}
|
||||
|
||||
//
|
||||
// Print utf16 text as utf8.
|
||||
//
|
||||
static void print_unicode(FILE *out, const uint16_t *text, unsigned nchars, int fill_flag)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i=0; i<nchars && *text; i++) {
|
||||
putc_utf8(*text++, out);
|
||||
}
|
||||
if (fill_flag) {
|
||||
for (; i<nchars; i++) {
|
||||
putc_utf8(' ', out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Print frequency (BCD value).
|
||||
//
|
||||
|
20
util.c
20
util.c
@ -208,3 +208,23 @@ void putc_utf8(unsigned short ch, FILE *out)
|
||||
putc ((ch & 0x3f) | 0x80, out);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Print utf16 text as utf8.
|
||||
//
|
||||
void print_unicode(FILE *out, const unsigned short *text, unsigned nchars, int fill_flag)
|
||||
{
|
||||
unsigned i, ch;
|
||||
|
||||
for (i=0; i<nchars && *text; i++) {
|
||||
ch = *text++;
|
||||
if (ch == '\t')
|
||||
ch = ' ';
|
||||
putc_utf8(ch, out);
|
||||
}
|
||||
if (fill_flag) {
|
||||
for (; i<nchars; i++) {
|
||||
putc(' ', out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
5
util.h
5
util.h
@ -124,3 +124,8 @@ void print_squelch_tones(FILE *out, int normal_only);
|
||||
// Write Unicode symbol to a file in UTF-8 encoding.
|
||||
//
|
||||
void putc_utf8(unsigned short ch, FILE *out);
|
||||
|
||||
//
|
||||
// Print utf16 text as utf8.
|
||||
//
|
||||
void print_unicode(FILE *out, const unsigned short *text, unsigned nchars, int fill_flag);
|
||||
|
17
uv380.c
17
uv380.c
@ -323,23 +323,6 @@ static void setup_zone(int zone_index, int chan_index)
|
||||
*data |= 1 << (chan_index & 7);
|
||||
}
|
||||
|
||||
//
|
||||
// Print utf16 text as utf8.
|
||||
//
|
||||
static void print_unicode(FILE *out, const uint16_t *text, unsigned nchars, int fill_flag)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i=0; i<nchars && *text; i++) {
|
||||
putc_utf8(*text++, out);
|
||||
}
|
||||
if (fill_flag) {
|
||||
for (; i<nchars; i++) {
|
||||
putc(' ', out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Print frequency (BCD value).
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user