Lazarus
Free Pascal => General => Topic started by: Zoran on September 24, 2022, 11:10:34 am
-
The official documentation (https://www.freepascal.org/docs-html/current/rtl/system/setcodepage.html) says nothing about how SetCodePage behaves when the string parameter contains characters which cannot be converted to resulting code page.
So, the question is, when calling this function with Convert parameter set to true, and the string contains some character that cannot be represented in new code page, will it raise some exception, or simply ignore it, or...?
-
What makes you think so?
A small example will help.
-
The character will be replaced with '?'
-
The character will be replaced with '?'
Thank you, Jonas!
What makes you think so?
A small example will help.
Thaddy, you misunderstood, I didn't think "so", as I didn't assume anything.
I just wanted to be sure, how to write the code to handle this situation -- should I enclose it in try-except or do it some other way.
So now I know.
And, by the way, I will handle it with doing nothing, as the default behaviour with "?" will be quite satisfying for what I need. :)