--unicode={default|locale|invalid|hex|escape|highlight}
-u {d|l|i|x|e|h}
- Determine how to handle UTF-8 unicode characters. The default
+ Determine how to handle UTF-8 unicode characters. The default
is no special treatment. All other versions of this option
only apply if the encoding is valid and enabling the option
implies --encoding=S.
static int address_radix;
/* Minimum length of sequence of graphic chars to trigger output. */
-static uint string_min;
+static unsigned int string_min;
/* Whether or not we include all whitespace as a graphic char. */
static bool include_all_whitespace;
case 's':
output_separator = optarg;
- break;
+ break;
case 'U':
if (streq (optarg, "default") || streq (optarg, "d"))
if ((buffer[2] & 0xc0) != 0x80)
return 0;
-
+
if ((buffer[0] & 0x10) == 0)
return 3;
of unicode_display. The character is known to be valid.
Returns the number of bytes consumed. */
-static uint
+static unsigned int
display_utf8_char (const unsigned char * buffer)
{
- uint j;
- uint utf8_len;
+ unsigned int j;
+ unsigned int utf8_len;
switch (buffer[0] & 0x30)
{
default:
utf8_len = 4;
}
-
+
switch (unicode_display)
{
default:
{
case 2:
printf ("\\u%02x%02x",
- ((buffer[0] & 0x1c) >> 2),
+ ((buffer[0] & 0x1c) >> 2),
((buffer[0] & 0x03) << 6) | (buffer[1] & 0x3f));
break;
return;
print_filename_and_address (filename, address + start_point);
-
+
/* We have found string_min characters. Display them and any
more that follow. */
for (i = start_point; i < buflen; i += char_len)
}
static int
-get_unicode_byte (FILE * stream, unsigned char * putback, uint * num_putback, uint * num_read)
+get_unicode_byte (FILE * stream,
+ unsigned char * putback,
+ unsigned int * num_putback,
+ unsigned int * num_read)
{
if (* num_putback > 0)
{
file_ptr address,
FILE * stream,
unsigned char * putback_buf,
- uint num_putback,
+ unsigned int num_putback,
unsigned char * print_buf)
{
/* It would be nice if we could just read the stream into a buffer
we go one byte at a time... */
file_ptr start_point = 0;
- uint num_read = 0;
- uint num_chars = 0;
- uint num_print = 0;
+ unsigned int num_read = 0;
+ unsigned int num_chars = 0;
+ unsigned int num_print = 0;
int c = 0;
/* Find a series of string_min characters. Put them into print_buf. */
print_filename_and_address (filename, address + start_point);
- uint i;
+ unsigned int i;
for (i = 0; i < num_print;)
{
if (print_buf[i] < 127)
/* OK so now we have to start read unchecked bytes. */
- /* Find a series of string_min characters. Put them into print_buf. */
+ /* Find a series of string_min characters. Put them into print_buf. */
do
{
c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read);
unsigned char * print_buf = xmalloc ((4 * string_min) + 1);
/* We should never have to put back more than 4 bytes. */
unsigned char putback_buf[5];
- uint num_putback = 0;
+ unsigned int num_putback = 0;
print_unicode_stream_body (filename, address, stream, putback_buf, num_putback, print_buf);
free (print_buf);
while (1)
{
file_ptr start;
- uint i;
+ unsigned int i;
long c;
/* See if the next `string_min' chars are all graphic chars. */