Andy Shaw
2018-11-14 08:34:50 UTC
Hi!
In connection to a support case I have been working on it was brought to my attention that there may be some problems that are connected to using qstricmp and other functions that are expecting latin1 strings for one reason or another. The reason that this might be a problem is because we are encoding our source code as UTF-8 and there is a theoretical problem that due to this that we are not protecting the strings correctly to ensure that they are treated as latin1 when we explicitly write them internally. It could be that reality is that this will never be a problem, and if that is the case then please give me the background on that so I can pass this on too.
For user code I get that we can just say that they should do something like:
qstricmp(str, QLatin1String("a").latin1());
and that would be ensuring it is correctly seen as a latin1 encoded string. If this is how it should be done, then shouldnât we change our usage of it in the Qt code as well to do the same thing? Or am I missing something?
Kind Regards,
Andy
In connection to a support case I have been working on it was brought to my attention that there may be some problems that are connected to using qstricmp and other functions that are expecting latin1 strings for one reason or another. The reason that this might be a problem is because we are encoding our source code as UTF-8 and there is a theoretical problem that due to this that we are not protecting the strings correctly to ensure that they are treated as latin1 when we explicitly write them internally. It could be that reality is that this will never be a problem, and if that is the case then please give me the background on that so I can pass this on too.
For user code I get that we can just say that they should do something like:
qstricmp(str, QLatin1String("a").latin1());
and that would be ensuring it is correctly seen as a latin1 encoded string. If this is how it should be done, then shouldnât we change our usage of it in the Qt code as well to do the same thing? Or am I missing something?
Kind Regards,
Andy