More WideString routines

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

More WideString routines

Felipe Monteiro de Carvalho
Hello,

>From time to time when I use widestring I miss equivalent functions to
those available for ansistrings.

At the moment I need a widestring replacement for StrPos. I searched
for WideStrPos in my FPC 2.2.2 but nothing came. Any ideas?

And if we really lack more widestring routines, where should they be placed?

thanks,
--
Felipe Monteiro de Carvalho
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: More WideString routines

theo-6
Felipe Monteiro de Carvalho schrieb:
> Hello,
>
>
> At the moment I need a widestring replacement for StrPos. I searched
> for WideStrPos in my FPC 2.2.2 but nothing came. Any ideas?
>
>  
StrPos is for PChar. Do you mean Pos? There are lots of versions of Pos.
One of them is
Function Pos (Const Substr : WideString; Const Source : WideString) :
SizeInt;

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: More WideString routines

Felipe Monteiro de Carvalho
Indeed, thanks,

But from time to time I also miss PWideChar routines, specially when
converting C code.

--
Felipe Monteiro de Carvalho
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: More WideString routines

Jonas Maebe-2

On 04 Aug 2009, at 17:56, Felipe Monteiro de Carvalho wrote:

> But from time to time I also miss PWideChar routines, specially when
> converting C code.

wchar_t seldom has the same size as widechar (it's very often 4  
bytes). Translating wchar_t* by pwidechar is therefore wrong (except  
for specific platforms).


Jonas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal