Thread overview
char/wchar/dchar phobos function calls
Apr 03, 2004
Walter
Apr 04, 2004
Walter
April 03, 2004
after reading the Dspecs... i understood that Walter considered Unicode the future.
the problem is that almost all functions from the standard library(std) do not support unicode.
examples:
    char[] getDirName(char[] fullname)
    void rename(char[] from, char[] to)

probably this question may sounds a little bit silly...
Can anyone explain me how we should support internationalization? Is it illegal to have unicode dir paths?
Is Unicode only used to communicate with a client, like error messages?

best regards,
Miguel Simões




April 03, 2004
My first thought was to have 3 versions of each library function, one for each UTF type. It quickly became clear that Phobos would get too large and bulky with this. So, the plan evolved so that Phobos would revolve about UTF-8 (which *is* unicode, so the library functions do support unicode). Currently, not all of the Phobos library functions handle UTF-8 correctly, but many do (see std.file).

  "Miguel Ferreira Simões" <kobold@netcabo.pt> wrote in message news:c4mc2t$1upj$1@digitaldaemon.com...
  after reading the Dspecs... i understood that Walter considered Unicode the future.
  the problem is that almost all functions from the standard library(std) do not support unicode.
  examples:
      char[] getDirName(char[] fullname)
      void rename(char[] from, char[] to)

  probably this question may sounds a little bit silly...
  Can anyone explain me how we should support internationalization? Is it illegal to have unicode dir paths?
  Is Unicode only used to communicate with a client, like error messages?

  best regards,
  Miguel Simões



April 04, 2004
Ok. But i did not understand a point: if i work with "char" and call any function of the Windows Api what version it will call? The Wide version (W) or the Ascii version (A)? So you are advicing me to use almost always "char"?

  "Walter" <walter@digitalmars.com> escreveu na mensagem news:c4n1bb$2v24$2@digitaldaemon.com...
  My first thought was to have 3 versions of each library function, one for each UTF type. It quickly became clear that Phobos would get too large and bulky with this. So, the plan evolved so that Phobos would revolve about UTF-8 (which *is* unicode, so the library functions do support unicode). Currently, not all of the Phobos library functions handle UTF-8 correctly, but many do (see std.file).


April 04, 2004
It's a bit tricky to make it work right, please look at std.file which I think works correctly and shows how to do it.
  "Miguel Ferreira Simões" <kobold@netcabo.pt> wrote in message news:c4pr07$vfb$1@digitaldaemon.com...
  Ok. But i did not understand a point: if i work with "char" and call any function of the Windows Api what version it will call?
  The Wide version (W) or the Ascii version (A)? So you are advicing me to use almost always "char"?

    "Walter" <walter@digitalmars.com> escreveu na mensagem news:c4n1bb$2v24$2@digitaldaemon.com...
    My first thought was to have 3 versions of each library function, one for each UTF type. It quickly became clear that Phobos would get too large and bulky with this. So, the plan evolved so that Phobos would revolve about UTF-8 (which *is* unicode, so the library functions do support unicode). Currently, not all of the Phobos library functions handle UTF-8 correctly, but many do (see std.file).