Home » U++ Library support » U++ Core » [FIXED] ToUpper, ToLower,and ToAscii (char*, int) causes AssertFailed
Re: [BUG] ToUpper, ToLower,and ToAscii (char*, int) causes AssertFailed [message #46591 is a reply to message #46583] |
Sun, 05 June 2016 18:15 |
|
mirek
Messages: 13980 Registered: November 2005
|
Ultimate Member |
|
|
There are two reasons why this crashes:
a) default encoding is UTF8 and with UTF8 conversion in general does not guarantee that the ouput number of bytes is the same as input one. Now in this case, it is, but I do not think it is even healthy to support this conversion. You can make it work by adding some 8-bit charset, like
ToUpper(s, 4, CHARSET_WIN1252);
b) you are overwriting string literal, which is undefined behaviour. So
#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
char s[] = "abcd";
ToUpper(s, 4, CHARSET_WIN1250);
}
Mirek
|
|
|
|
|
[FIXED] ToUpper, ToLower,and ToAscii (char*, int) causes AssertFailed
By: omari on Fri, 03 June 2016 13:21
|
|
|
Re: [BUG] ToUpper, ToLower,and ToAscii (char*, int) causes AssertFailed
By: mirek on Sun, 05 June 2016 18:15
|
|
|
Re: [BUG] ToUpper, ToLower,and ToAscii (char*, int) causes AssertFailed
By: omari on Mon, 06 June 2016 12:56
|
|
|
Re: [BUG] ToUpper, ToLower,and ToAscii (char*, int) causes AssertFailed
By: mirek on Thu, 09 June 2016 14:27
|
|
|
Re: [BUG] ToUpper, ToLower,and ToAscii (char*, int) causes AssertFailed
By: omari on Fri, 10 June 2016 11:56
|
Goto Forum:
Current Time: Sat May 18 03:49:03 CEST 2024
Total time taken to generate the page: 0.02053 seconds
|