{
struct print_trns *trns = trns_;
bool eject = trns->eject;
- char encoded_space = legacy_from_native (trns->encoding, ' ');
+ char encoded_space = recode_byte (trns->encoding, LEGACY_NATIVE, ' ');
int record = 1;
struct prt_out_spec *spec;
else
leader = '1';
}
- line[0] = legacy_from_native (trns->encoding, leader);
+ line[0] = recode_byte (trns->encoding, LEGACY_NATIVE, leader);
if (trns->writer == NULL)
tab_output_text (TAB_FIX, &line[1]);
/* PSPP - a program for statistical analysis.
- Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009, 2010, 2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
return converter->conv;
}
+/* Converts the single byte C from encoding FROM to TO, returning the first
+ byte of the result.
+
+ This function probably shouldn't be used at all, but some code still does
+ use it. */
+char
+recode_byte (const char *to, const char *from, char c)
+{
+ char x;
+ char *s = recode_string (to, from, &c, 1);
+ x = s[0];
+ free (s);
+ return x;
+}
/* Similar to recode_string_pool, but allocates the returned value on the heap
instead of in a pool. It is the caller's responsibility to free the
struct pool;
+char recode_byte (const char *to, const char *from, char);
+
char *recode_string (const char *to, const char *from,
const char *text, int len);
char *recode_string_pool (const char *to, const char *from,