forked from len0rd/rockbox
Convert non-ASCII characters to UTF-8 or C-string literals
Comments are converted to UTF-8. Strings which are part of executable code are converted using C-string hex literals. A comment with the intended UTF-8 character is appended to such lines. The "c"-looking character in mpa.c was actually a small cyrillic "s" (i.e. "с"). Change-Id: If3a889080ef60b8bf756ad9ada38baede93ce35b
This commit is contained in:
parent
5d7c8a0df1
commit
1468649258
5 changed files with 25 additions and 25 deletions
|
@ -458,7 +458,7 @@ short unstable_getpacket (short *other, char *bufptr)
|
||||||
{
|
{
|
||||||
/* GOOD! Take second half of double packet */
|
/* GOOD! Take second half of double packet */
|
||||||
#if (PRINTERRORS)
|
#if (PRINTERRORS)
|
||||||
printf("\n%ld-%ld .û ",gcom->buffer[0],(gcom->buffer[0]+1)&255);
|
printf("\n%ld-%ld .\xFB ",gcom->buffer[0],(gcom->buffer[0]+1)&255); /* √ */
|
||||||
#endif
|
#endif
|
||||||
messleng = ((long)gcom->buffer[3]) + (((long)gcom->buffer[4])<<8);
|
messleng = ((long)gcom->buffer[3]) + (((long)gcom->buffer[4])<<8);
|
||||||
lastpacketleng = gcom->numbytes-7-messleng;
|
lastpacketleng = gcom->numbytes-7-messleng;
|
||||||
|
@ -478,7 +478,7 @@ short unstable_getpacket (short *other, char *bufptr)
|
||||||
if ((gcom->buffer[1]&128) == 0) /* Single packet */
|
if ((gcom->buffer[1]&128) == 0) /* Single packet */
|
||||||
{
|
{
|
||||||
#if (PRINTERRORS)
|
#if (PRINTERRORS)
|
||||||
printf("\n%ld û ",gcom->buffer[0]);
|
printf("\n%ld \xFB ",gcom->buffer[0]); /* √ */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
messleng = gcom->numbytes-5;
|
messleng = gcom->numbytes-5;
|
||||||
|
@ -491,7 +491,7 @@ short unstable_getpacket (short *other, char *bufptr)
|
||||||
|
|
||||||
/* Double packet */
|
/* Double packet */
|
||||||
#if (PRINTERRORS)
|
#if (PRINTERRORS)
|
||||||
printf("\n%ld-%ld ûû ",gcom->buffer[0],(gcom->buffer[0]+1)&255);
|
printf("\n%ld-%ld \xFB\xFB ",gcom->buffer[0],(gcom->buffer[0]+1)&255); /* √√ */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
messleng = ((long)gcom->buffer[3]) + (((long)gcom->buffer[4])<<8);
|
messleng = ((long)gcom->buffer[3]) + (((long)gcom->buffer[4])<<8);
|
||||||
|
|
|
@ -102,36 +102,36 @@ void TextFrame
|
||||||
}
|
}
|
||||||
if ( type == SINGLE_FRAME )
|
if ( type == SINGLE_FRAME )
|
||||||
{
|
{
|
||||||
DrawText( x1, y1, 'Ú', foreground, background );
|
DrawText( x1, y1, '\xDA', foreground, background ); /* ┌ */
|
||||||
DrawText( x2, y1, '¿', foreground, background );
|
DrawText( x2, y1, '\xBF', foreground, background ); /* ┐ */
|
||||||
DrawText( x1, y2, 'À', foreground, background );
|
DrawText( x1, y2, '\xC0', foreground, background ); /* └ */
|
||||||
DrawText( x2, y2, 'Ù', foreground, background );
|
DrawText( x2, y2, '\xD9', foreground, background ); /* ┘ */
|
||||||
for( x = x1 + 1; x < x2; x++ )
|
for( x = x1 + 1; x < x2; x++ )
|
||||||
{
|
{
|
||||||
DrawText( x, y1, 'Ä', foreground, background );
|
DrawText( x, y1, '\xC4', foreground, background ); /* ─ */
|
||||||
DrawText( x, y2, 'Ä', foreground, background );
|
DrawText( x, y2, '\xC4', foreground, background ); /* ─ */
|
||||||
}
|
}
|
||||||
for( y = y1 + 1; y < y2; y++ )
|
for( y = y1 + 1; y < y2; y++ )
|
||||||
{
|
{
|
||||||
DrawText( x1, y, '³', foreground, background );
|
DrawText( x1, y, '\xB3', foreground, background ); /* │ */
|
||||||
DrawText( x2, y, '³', foreground, background );
|
DrawText( x2, y, '\xB3', foreground, background ); /* │ */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( type == DOUBLE_FRAME )
|
if ( type == DOUBLE_FRAME )
|
||||||
{
|
{
|
||||||
DrawText( x1, y1, 'É', foreground, background );
|
DrawText( x1, y1, '\xC9', foreground, background ); /* ╔ */
|
||||||
DrawText( x2, y1, '»', foreground, background );
|
DrawText( x2, y1, '\xBB', foreground, background ); /* ╗ */
|
||||||
DrawText( x1, y2, 'È', foreground, background );
|
DrawText( x1, y2, '\xC8', foreground, background ); /* ╚ */
|
||||||
DrawText( x2, y2, '¼', foreground, background );
|
DrawText( x2, y2, '\xBC', foreground, background ); /* ╝ */
|
||||||
for( x = x1 + 1; x < x2; x++ )
|
for( x = x1 + 1; x < x2; x++ )
|
||||||
{
|
{
|
||||||
DrawText( x, y1, 'Í', foreground, background );
|
DrawText( x, y1, '\xCD', foreground, background ); /* ═ */
|
||||||
DrawText( x, y2, 'Í', foreground, background );
|
DrawText( x, y2, '\xCD', foreground, background ); /* ═ */
|
||||||
}
|
}
|
||||||
for( y = y1 + 1; y < y2; y++ )
|
for( y = y1 + 1; y < y2; y++ )
|
||||||
{
|
{
|
||||||
DrawText( x1, y, 'º', foreground, background );
|
DrawText( x1, y, '\xBA', foreground, background ); /* ║ */
|
||||||
DrawText( x2, y, 'º', foreground, background );
|
DrawText( x2, y, '\xBA', foreground, background ); /* ║ */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,7 +207,7 @@ static int get_file_pos(int newtime)
|
||||||
if (pos == -1 || (skipms_from_curpos >= 0 && pos > curpos) || (skipms_from_curpos < 0 && pos < curpos))
|
if (pos == -1 || (skipms_from_curpos >= 0 && pos > curpos) || (skipms_from_curpos < 0 && pos < curpos))
|
||||||
{
|
{
|
||||||
pos = curpos - skipms_from_curpos * (id3->filesize / id3->length);
|
pos = curpos - skipms_from_curpos * (id3->filesize / id3->length);
|
||||||
//LOGF("сurpos relative seek: %d, curpos: %d, newtime: %d", pos, curpos, newtime);
|
//LOGF("curpos relative seek: %d, curpos: %d, newtime: %d", pos, curpos, newtime);
|
||||||
}
|
}
|
||||||
} else if (id3->bitrate) {
|
} else if (id3->bitrate) {
|
||||||
pos = newtime * (id3->bitrate / 8);
|
pos = newtime * (id3->bitrate / 8);
|
||||||
|
|
|
@ -133,9 +133,9 @@ static const struct device_info devices[] =
|
||||||
{"C\0r\0e\0a\0t\0i\0v\0e\0 \0Z\0e\0n\0 \0V\0i\0s\0i\0o\0n\0:\0M", 42, null_key_v2},
|
{"C\0r\0e\0a\0t\0i\0v\0e\0 \0Z\0e\0n\0 \0V\0i\0s\0i\0o\0n\0:\0M", 42, null_key_v2},
|
||||||
/* Creative Zen Vision:M Go! */
|
/* Creative Zen Vision:M Go! */
|
||||||
{"C\0r\0e\0a\0t\0i\0v\0e\0 \0Z\0e\0n\0 \0V\0i\0s\0i\0o\0n\0:\0M\0 \0G\0o\0!", 50, null_key_v2},
|
{"C\0r\0e\0a\0t\0i\0v\0e\0 \0Z\0e\0n\0 \0V\0i\0s\0i\0o\0n\0:\0M\0 \0G\0o\0!", 50, null_key_v2},
|
||||||
/* Creative Zen Vision © TL */
|
/* Creative Zen Vision © TL */
|
||||||
/* The "©" should be ANSI encoded or the device won't accept the firmware package. */
|
/* The "©" should be ANSI encoded or the device won't accept the firmware package. */
|
||||||
{"C\0r\0e\0a\0t\0i\0v\0e\0 \0Z\0e\0n\0 \0V\0i\0s\0i\0o\0n\0 \0©\0T\0L", 46, null_key_v2},
|
{"C\0r\0e\0a\0t\0i\0v\0e\0 \0Z\0e\0n\0 \0V\0i\0s\0i\0o\0n\0 \0\xA9\0T\0L", 46, null_key_v2},
|
||||||
/* Creative ZEN V */
|
/* Creative ZEN V */
|
||||||
{"C\0r\0e\0a\0t\0i\0v\0e\0 \0Z\0E\0N\0 \0V", 42, null_key_v4},
|
{"C\0r\0e\0a\0t\0i\0v\0e\0 \0Z\0E\0N\0 \0V", 42, null_key_v4},
|
||||||
/* Creative ZEN */
|
/* Creative ZEN */
|
||||||
|
|
|
@ -998,7 +998,7 @@ int mkboot(const char* infile, const char* bootfile, const char* outfile, struct
|
||||||
log_message("[INFO] Locating encoded block... ");
|
log_message("[INFO] Locating encoded block... ");
|
||||||
|
|
||||||
i = 8;
|
i = 8;
|
||||||
while(memcmp(&out_buffer[i], " LT©", 4) != 0 && i < ciff_size)
|
while(memcmp(&out_buffer[i], " LT\xA9", 4) != 0 && i < ciff_size) /* " LT©" */
|
||||||
{
|
{
|
||||||
if(memcmp(&out_buffer[i], "FNIC", 4) == 0)
|
if(memcmp(&out_buffer[i], "FNIC", 4) == 0)
|
||||||
i += 4+4+96;
|
i += 4+4+96;
|
||||||
|
@ -1017,7 +1017,7 @@ int mkboot(const char* infile, const char* bootfile, const char* outfile, struct
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(i > ciff_size || memcmp(&out_buffer[i], " LT©", 4) != 0)
|
if(i > ciff_size || memcmp(&out_buffer[i], " LT\xA9", 4) != 0) /* " LT©" */
|
||||||
{
|
{
|
||||||
log_message("Fail!\n[ERR] Couldn't find encoded block\n");
|
log_message("Fail!\n[ERR] Couldn't find encoded block\n");
|
||||||
fclose(bootfd);
|
fclose(bootfd);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue