[fpc-devel] bug report 20473: Please add a directive to define string=utf8string
Sven Barth
pascaldragon at googlemail.com
Thu Oct 13 11:59:03 CEST 2011
Am 13.10.2011 11:53, schrieb Alex Shishkin:
> another alternative. in {$H-} no changes string=shortstring, in {$h+}
> string = ansistring or unocodestring in delphiunicode mode) by default
> but can be redefined directly in code (or this definition is set in
> ObjPas unit) "type string = MyNiceStringType". and this redefinition is
> inherited from used unit if all of them compiled in {$h+} mode. In other
> words if unit has directive {$h-} string=shortstring in any case, but if
> unit has {$h+} it use "string" type from used unit as it is regular type.
Defining the "string" type in a unit (e.g. the ObjPas unit) is a bad
idea if you want to keep the capability to change the "string" type on a
per unit base as you can't change the compiled ObjPas unit. Also you'd
need a unit for every string type that should be supported.
The proposal where "string" is changed based on some compiler
option/define is better (though the question about its use or
consequences is still not solved).
Regards,
Sven
More information about the fpc-devel
mailing list