Jump to page: 1 2 3
Thread overview
utf and std.file
Apr 29, 2004
C
Apr 30, 2004
Matthew
May 03, 2004
Walter
May 03, 2004
Walter
May 03, 2004
J C Calvarese
May 03, 2004
Walter
May 03, 2004
J C Calvarese
May 04, 2004
Walter
May 04, 2004
Walter
std.utf.validate (was Re: utf and std.file)
May 07, 2004
Walter
lost (was Re: std.utf.validate (was Re: utf and std.file))
May 19, 2004
Walter
May 20, 2004
Walter
May 21, 2004
J C Calvarese
May 21, 2004
Walter
May 24, 2004
Walter
April 29, 2004
This simple program:

import std.file;
import std.c.stdio;
import std.path;
import std.utf;
void main() {
char [][] archivos = listdir( curdir ) ;
foreach ( char [] a ; archivos )
try
validate(a);
catch (UtfError)
printf("%.*s: invalid\n",a);
}

Outputs "invalid" for any file that contains in its name any of: áéíóúñÁÉÍÓÚÑ,
and maybe other characters. That means that for any file named, say,
"año2004.dat", I can't do anything with it because DMD thinks its name is not
valid. That's annoying, at least for me, because those are characters that are
used all the time in Spanish and other languages, so I tend to name my files
using those characters.

-------------------
Carlos Santander B.
April 29, 2004
Sorry if this is a stupid question , but does that mean file names can be anything ?  Do the Russians use russian charaters for their files etc. ?

C

Carlos Santander B. wrote:
> This simple program:
> 
> import std.file;
> import std.c.stdio;
> import std.path;
> import std.utf;
> void main() {
> char [][] archivos = listdir( curdir ) ;
> foreach ( char [] a ; archivos )
> try validate(a);
> catch (UtfError)
> printf("%.*s: invalid\n",a);
> }
> 
> Outputs "invalid" for any file that contains in its name any of: áéíóúñÁÉÍÓÚÑ,
> and maybe other characters. That means that for any file named, say,
> "año2004.dat", I can't do anything with it because DMD thinks its name is not
> valid. That's annoying, at least for me, because those are characters that are
> used all the time in Spanish and other languages, so I tend to name my files
> using those characters.
> 
> -------------------
> Carlos Santander B.
April 30, 2004
He, he. You're American, right?

<G>

"C" <dont@respond.com> wrote in message news:c6rcsk$1sei$1@digitaldaemon.com...
> Sorry if this is a stupid question , but does that mean file names can
> be anything ?  Do the Russians use russian charaters for their files etc. ?
>
> C
>
> Carlos Santander B. wrote:
> > This simple program:
> >
> > import std.file;
> > import std.c.stdio;
> > import std.path;
> > import std.utf;
> > void main() {
> > char [][] archivos = listdir( curdir ) ;
> > foreach ( char [] a ; archivos )
> > try
> > validate(a);
> > catch (UtfError)
> > printf("%.*s: invalid\n",a);
> > }
> >
> > Outputs "invalid" for any file that contains in its name any of:
áéíóúñÁÉÍÓÚÑ,
> > and maybe other characters. That means that for any file named, say, "año2004.dat", I can't do anything with it because DMD thinks its name is not valid. That's annoying, at least for me, because those are characters that
are
> > used all the time in Spanish and other languages, so I tend to name my files using those characters.
> >
> > -------------------
> > Carlos Santander B.


May 03, 2004
"Carlos Santander B." <Carlos_member@pathlink.com> wrote in message news:c6rbd4$1q4a$1@digitaldaemon.com...
> Outputs "invalid" for any file that contains in its name any of:
áéíóúñÁÉÍÓÚÑ,
> and maybe other characters. That means that for any file named, say, "año2004.dat", I can't do anything with it because DMD thinks its name is
not
> valid. That's annoying, at least for me, because those are characters that
are
> used all the time in Spanish and other languages, so I tend to name my
files
> using those characters.

Is it possible to use a unicode text editor instead? D doesn't support code pages, relying instead on unicode.


May 03, 2004
"Walter" <newshound@digitalmars.com> wrote in message
news:c747m1$5te$1@digitaldaemon.com
| "Carlos Santander B." <Carlos_member@pathlink.com> wrote in message
| news:c6rbd4$1q4a$1@digitaldaemon.com...
|| Outputs "invalid" for any file that contains in its name any of:
| áéíóúñÁÉÍÓÚÑ,
|| and maybe other characters. That means that for any file named, say,
|| "año2004.dat", I can't do anything with it because DMD thinks its name is
| not
|| valid. That's annoying, at least for me, because those are characters
that
| are
|| used all the time in Spanish and other languages, so I tend to name my
| files
|| using those characters.
|
| Is it possible to use a unicode text editor instead? D doesn't support
code
| pages, relying instead on unicode.

I don't understand. Let's say I have a file "año" and I want to read it from my D program. D won't let me because it says it's not a valid string. At the very least I'd like to read the file, but I can't.

-----------------------
Carlos Santander Bernal


May 03, 2004
"Carlos Santander B." <carlos8294@msn.com> wrote in message news:c74do5$e3t$1@digitaldaemon.com...
> "Walter" <newshound@digitalmars.com> wrote in message
> news:c747m1$5te$1@digitaldaemon.com
> | "Carlos Santander B." <Carlos_member@pathlink.com> wrote in message
> | news:c6rbd4$1q4a$1@digitaldaemon.com...
> || Outputs "invalid" for any file that contains in its name any of:
> | áéíóúñÁÉÍÓÚÑ,
> || and maybe other characters. That means that for any file named, say,
> || "año2004.dat", I can't do anything with it because DMD thinks its name
is
> | not
> || valid. That's annoying, at least for me, because those are characters
> that
> | are
> || used all the time in Spanish and other languages, so I tend to name my
> | files
> || using those characters.
> |
> | Is it possible to use a unicode text editor instead? D doesn't support
> code
> | pages, relying instead on unicode.
>
> I don't understand. Let's say I have a file "año" and I want to read it
from
> my D program. D won't let me because it says it's not a valid string. At
the
> very least I'd like to read the file, but I can't.

There are two ways to do international character sets - one way is using unicode, which D supports (as does Win32 with 16 bit wchar's). The other way is a horrible kludge called "code pages". I presume you are using code pages. Can you switch to using unicode?


May 03, 2004
Walter wrote:
> "Carlos Santander B." <carlos8294@msn.com> wrote in message news:c74do5$e3t$1@digitaldaemon.com...
> 
>>"Walter" <newshound@digitalmars.com> wrote in message
>>news:c747m1$5te$1@digitaldaemon.com
>>| "Carlos Santander B." <Carlos_member@pathlink.com> wrote in message
>>| news:c6rbd4$1q4a$1@digitaldaemon.com...
>>|| Outputs "invalid" for any file that contains in its name any of:
>>| áéíóúñÁÉÍÓÚÑ,
>>|| and maybe other characters. That means that for any file named, say,
>>|| "año2004.dat", I can't do anything with it because DMD thinks its name
> 
> is
> 
>>| not
>>|| valid. That's annoying, at least for me, because those are characters
>>that
>>| are
>>|| used all the time in Spanish and other languages, so I tend to name my
>>| files
>>|| using those characters.
>>|
>>| Is it possible to use a unicode text editor instead? D doesn't support
>>code
>>| pages, relying instead on unicode.
>>
>>I don't understand. Let's say I have a file "año" and I want to read it
> 
> from
> 
>>my D program. D won't let me because it says it's not a valid string. At
> 
> the
> 
>>very least I'd like to read the file, but I can't.
> 
> 
> There are two ways to do international character sets - one way is using unicode, which D supports (as does Win32 with 16 bit wchar's). The other way is a horrible kludge called "code pages". I presume you are using code pages. Can you switch to using unicode?

I think Carlos Santander is trying to use a non-English character in a filename. I attached an example of what I found won't work.

The compiler won't even admit the file is there. I suspect this is a moot point if the linker (written in hand-tuned assembly) wouldn't handle such a filename either.

-- 
Justin
http://jcc_7.tripod.com/d/


May 03, 2004
"J C Calvarese" <jcc7@cox.net> wrote in message news:c74m7l$qk3$1@digitaldaemon.com...
> Walter wrote:
> > "Carlos Santander B." <carlos8294@msn.com> wrote in message news:c74do5$e3t$1@digitaldaemon.com...
> >
> >>"Walter" <newshound@digitalmars.com> wrote in message
> >>news:c747m1$5te$1@digitaldaemon.com
> >>| "Carlos Santander B." <Carlos_member@pathlink.com> wrote in message
> >>| news:c6rbd4$1q4a$1@digitaldaemon.com...
> >>|| Outputs "invalid" for any file that contains in its name any of:
> >>| áéíóúñÁÉÍÓÚÑ,
> >>|| and maybe other characters. That means that for any file named, say,
> >>|| "año2004.dat", I can't do anything with it because DMD thinks its
name
> >
> > is
> >
> >>| not
> >>|| valid. That's annoying, at least for me, because those are characters
> >>that
> >>| are
> >>|| used all the time in Spanish and other languages, so I tend to name
my
> >>| files
> >>|| using those characters.
> >>|
> >>| Is it possible to use a unicode text editor instead? D doesn't support
> >>code
> >>| pages, relying instead on unicode.
> >>
> >>I don't understand. Let's say I have a file "año" and I want to read it
> >
> > from
> >
> >>my D program. D won't let me because it says it's not a valid string. At
> >
> > the
> >
> >>very least I'd like to read the file, but I can't.
> >
> >
> > There are two ways to do international character sets - one way is using unicode, which D supports (as does Win32 with 16 bit wchar's). The other
way
> > is a horrible kludge called "code pages". I presume you are using code pages. Can you switch to using unicode?
>
> I think Carlos Santander is trying to use a non-English character in a filename. I attached an example of what I found won't work.

I think he's talking about non-english characters in D strings, not in D source code filenames.

> The compiler won't even admit the file is there. I suspect this is a moot point if the linker (written in hand-tuned assembly) wouldn't handle such a filename either.
>
> -- 
> Justin
> http://jcc_7.tripod.com/d/
>


May 03, 2004
In article <c7521v$1dnt$3@digitaldaemon.com>, Walter says...
>
>
>"J C Calvarese" <jcc7@cox.net> wrote in message news:c74m7l$qk3$1@digitaldaemon.com...
>> Walter wrote:
>> > "Carlos Santander B." <carlos8294@msn.com> wrote in message news:c74do5$e3t$1@digitaldaemon.com...
>> >
>> >>"Walter" <newshound@digitalmars.com> wrote in message
>> >>news:c747m1$5te$1@digitaldaemon.com
>> >>| "Carlos Santander B." <Carlos_member@pathlink.com> wrote in message
>> >>| news:c6rbd4$1q4a$1@digitaldaemon.com...
>> >>|| Outputs "invalid" for any file that contains in its name any of:
>> >>| áéíóúñÁÉÍÓÚÑ,
>> >>|| and maybe other characters. That means that for any file named, say,
>> >>|| "año2004.dat", I can't do anything with it because DMD thinks its
>name
>> >
>> > is
>> >
>> >>| not
>> >>|| valid. That's annoying, at least for me, because those are characters
>> >>that
>> >>| are
>> >>|| used all the time in Spanish and other languages, so I tend to name
>my
>> >>| files
>> >>|| using those characters.
>> >>|
>> >>| Is it possible to use a unicode text editor instead? D doesn't support
>> >>code
>> >>| pages, relying instead on unicode.
>> >>
>> >>I don't understand. Let's say I have a file "año" and I want to read it
>> >
>> > from
>> >
>> >>my D program. D won't let me because it says it's not a valid string. At
>> >
>> > the
>> >
>> >>very least I'd like to read the file, but I can't.
>> >
>> >
>> > There are two ways to do international character sets - one way is using unicode, which D supports (as does Win32 with 16 bit wchar's). The other
>way
>> > is a horrible kludge called "code pages". I presume you are using code pages. Can you switch to using unicode?
>>
>> I think Carlos Santander is trying to use a non-English character in a filename. I attached an example of what I found won't work.
>
>I think he's talking about non-english characters in D strings, not in D source code filenames.

Oops. What was I thinking? I must have been half-asleep.

Justin


May 03, 2004
"Carlos Santander B." <Carlos_member@pathlink.com> wrote in message
news:c6rbd4$1q4a$1@digitaldaemon.com
| This simple program:
|
| import std.file;
| import std.c.stdio;
| import std.path;
| import std.utf;
| void main() {
| char [][] archivos = listdir( curdir ) ;
| foreach ( char [] a ; archivos )
| try
| validate(a);
| catch (UtfError)
| printf("%.*s: invalid\n",a);
| }
|
| Outputs "invalid" for any file that contains in its name any of:
áéíóúñÁÉÍÓÚÑ,
| and maybe other characters. That means that for any file named, say,
| "año2004.dat", I can't do anything with it because DMD thinks its name is
not
| valid. That's annoying, at least for me, because those are characters that
are
| used all the time in Spanish and other languages, so I tend to name my
files
| using those characters.
|

Walter, did you do any changes to the compiler for 0.86 regarding UTF? Because now I ran the same code but on WinXP Pro (previously it was in Win98) and it works just well. I'm gonna test it again tomorrow on 98 to see if it's the OS.

-----------------------
Carlos Santander Bernal


« First   ‹ Prev
1 2 3