euro sign

Sivo Schilling sivo.schilling at web.de
Wed May 6 11:42:25 PDT 2009


nobody Wrote:

> Hello,
> 
> import std.stdio;
> 
> void main() {
>     wchar w_sonderzeichen= '\u20ac';    // Euro Zeichen
>     writef("w_sonderzeichen = %s ",w_sonderzeichen) ;
> }
> 
> capri at capri-desktop:~/dd$ dmd utf_test.d
> /home/capri/dd/dmd/src/phobos/std/stdio.d(823): Error: undefined identifier backend
> /home/capri/dd/dmd/src/phobos/std/stdio.d(823): Error: function std.stdio.fputc_unlocked (int, _iobuf*) does not match parameter types (wchar,int)
> /home/capri/dd/dmd/src/phobos/std/stdio.d(823): Error: cannot implicitly convert expression (backend) of type int to _iobuf*
> /home/capri/dd/dmd/src/phobos/std/stdio.d(830): Error: undefined identifier backend
> /home/capri/dd/dmd/src/phobos/std/stdio.d(830): Error: function std.stdio.fputc_unlocked (int, _iobuf*) does not match parameter types (char,int)
> /home/capri/dd/dmd/src/phobos/std/stdio.d(830): Error: cannot implicitly convert expression (backend) of type int to _iobuf*
> /home/capri/dd/dmd/src/phobos/std/stdio.d(835): Error: undefined identifier backend
> /home/capri/dd/dmd/src/phobos/std/stdio.d(835): Error: function std.stdio.fputwc_unlocked (dchar, _iobuf*) does not match parameter types (wchar,int)
> /home/capri/dd/dmd/src/phobos/std/stdio.d(835): Error: cannot implicitly convert expression (backend) of type int to _iobuf*
> /home/capri/dd/dmd/src/phobos/std/stdio.d(1982): Error: template instance std.stdio.File.LockingTextWriter.put!(wchar) error instantiating
> 
> DMD 2.029 under linux
> 

Hi 

the error messages are the same on Windows XP. The problem
seems to be the type of 'w_sonderzeichen'.
If you change the type from wchar to dchar then dmd is happy
and at least on linux you see the Euro sign (on Windows console
output is not very useful).

Chears,
Sivo.

---
import std.stdio;

void main()
{
    dchar w_sonderzeichen = '\u20ac';    // Euro Zeichen
    writefln("w_sonderzeichen = %s ", w_sonderzeichen) ;
}
---

Output:
w_sonderzeichen = €



More information about the Digitalmars-d-learn mailing list