User Changes Trunk

From Free Pascal wiki
Revision as of 20:35, 8 September 2007 by Jonas (talk | contribs) (New page with changes that may affect users in trunk. First entry: char/widechar conversions)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

About this page

Below you can find a list of intentional changes since the the previous release which can change the behaviour of previously working code, along with why these changes were performed and how you can adapt your code if you are affected by them.

All systems

Char to WideChar conversions and vice versa

  • Old behaviour: Type conversions between chars and widechars did not cause any translations of the data.
  • New behaviour: A char to a widechar conversion or vice versa now triggers the widestring manager, and converts the data from ansichar to widechar or the other way around. If a converted widechar is not representable in a single char, the result of the conversion is always '?'
  • Example: char_var:=char(widechar_var); used to put the lower 8 bits of widechar_var into char_var, while now the widestring manager is called to translate widechar_var from UTF-16 to the active code page.
  • Reason: Bug report 7758, and consistency with conversions between shortstrings/ansistrings and widestrings.
  • Effect: If you previously typecasted chars to widechars or the other way around (possibly via parameter passing or assignments), these type conversions will now cause the data to be translated.
  • Remedy: If you do not want any translation to be performed, add an additional type conversion to an integer type in between, e.g. char_var:=char(word(widechar_var));