[Gambas-user] String processing in Wiki
Benoit Minisini
gambas at ...1...
Tue Mar 28 12:40:04 CEST 2006
On Tuesday 28 March 2006 11:44, Eilert wrote:
> Today I've translated the functions starting with C into German.
>
> There are some functions where there is a special hint that they only
> deal with ASCII, but Gambas deals with UTF-8.
>
> Now there are two general questions of mine :-)
>
> - Why do some of the functions use ASCII and some do not, and are there
> plans to make it uniform (all using UTF-8),
No.
> or are there other important
> reasons for not to do so?
Yes.
There is a difference between a string to translate (that will be displayed
somewhere), and a string that must not be translated, i.e. that is just used
by the program logic (a collection key, a english-only syntax...).
UTF-8 strings are heavier to process than ASCII strings, as the size of a
character is not necessarily one byte.
>
> - If it has to be as it is, shouldn't we add a little hint into every
> string function to make clear if it is ASCII or UTF-8? Like a symbol or
> so...
All native string functions are ASCII-only, and all UTF-8 string functions
were put in the String static class.
The String class is not complete at the moment, and some of its methods do not
have well-chosen names.
>
> And a special question:
>
> - I was wondering why the hint "Be careful! The current localization is
> not used by this function." is mentioned for functions like CSng(). What
> do such functions have to do with localisation, and why does CShort()
> doesn't mention it then?
The decimal separator can be different when the language changes.
Integer numbers seems to be written the same way in every language.
>
> Thanks for your responses.
>
> Regards
> Rolf
>
Regards,
--
Benoit Minisini
More information about the User
mailing list