Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-03

ansistring <--> widestring conversion

2 messages · 1 person · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

peter green

i post here a heavilly modified version of the widestring code (and a couple of files from the xml code that depend on it)

i have made the ansi <--> wide conversion routines take a buffer and length as input but make the return in an ansistring/widestring var parameter i believe this gives a good compromise between performance and flexibility (most other ways of returning a variable length string are hacky to say the least) furthermore i think the cases where the output isn't being put into an ansistring or widestring will be very rare anyway.

i also made the default/fallback conversion do a direct mapping of all values up to 255 rather than just up to 127 and made it use a ? rather than a space to replace unknown codes.

this code seems to all compile ok but for some reason some gtk2 stuff has suddenly failed on me (which since grep didn't turn up anything widestring related seems very strange) preventing me from completing a make all. im not sure if this happens with the unmodified snapshot as well. the code has had no functional testing yet (does anyone know how to fun a modified compiler through the testsuite?)

Reply by email

peter green
to peter green

btw theese changes have already been committed (i sent them personally to fpk). It seems like this mail was held for approval or something (i previously thought it had been dropped)

Show quoted text 35 lines
-----Original Message----- From: Behalf Of peter green Sent: 11 March 2005 03:33 To: Subject: [fpc-devel] ansistring <--> widestring conversion i post here a heavilly modified version of the widestring code (and a couple of files from the xml code that depend on it) i have made the ansi <--> wide conversion routines take a buffer and length as input but make the return in an ansistring/widestring var parameter i believe this gives a good compromise between performance and flexibility (most other ways of returning a variable length string are hacky to say the least) furthermore i think the cases where the output isn't being put into an ansistring or widestring will be very rare anyway. i also made the default/fallback conversion do a direct mapping of all values up to 255 rather than just up to 127 and made it use a ? rather than a space to replace unknown codes. this code seems to all compile ok but for some reason some gtk2 stuff has suddenly failed on me (which since grep didn't turn up anything widestring related seems very strange) preventing me from completing a make all. im not sure if this happens with the unmodified snapshot as well. the code has had no functional testing yet (does anyone know how to fun a modified compiler through the testsuite?)

Reply by email