Thread: Opening file with Euro symbol in pathname.

  1. #16
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by esbo View Post
    Do they offer support for a graphical interface s you seem what I mean?
    IE windows type dialogue boxes, graphical display etc, cursor detection etc...???
    Most compilers do these days.

    Take a look at :

    theForger's Win32 API Tutorial

    Windows Development (Windows)

    Introduction to Windows Programming in C++ (Windows)

    These should get you started...

  2. #17
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by esbo View Post
    It is not a virus.

    I created the files with a "dir >somefile.txt"

    The ? is in the somefile.txt so it seems MSDOS is the problem or part of the problem.

    I the Euro was not invented when MSDOS was around.
    I think the DJGPP compiler must use the same DOS commands to open the file.

    It's not a forbidden character, ie is the € sign.

    That is in the extended ascii character set.
    If it is the euro symbol then its character code cannot possibly be 63. I'm still confused. Also, there's no such thing as "extended ASCII".
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  3. #18
    Fountain of knowledge.
    Join Date
    May 2006
    Posts
    794
    Quote Originally Posted by brewbuck View Post
    If it is the euro symbol then its character code cannot possibly be 63. I'm still confused. Also, there's no such thing as "extended ASCII".

    Yes there is.


    In the "dir>filename" it appears as a ?

    I have to over write the 63 with 128 in the code.

  4. #19
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by esbo View Post
    Yes there is.
    There is not. Read Wikipedia:

    The term extended ASCII (or high ASCII) describes eight-bit or larger character encodings that include the standard seven-bit ASCII characters as well as others. The use of the term is sometimes criticized, because it can be mistakenly interpreted that the ASCII standard has been updated to include more than 128 characters or that the term unambiguously identifies a single encoding, both of which are untrue.
    Your problem is that you're using "dir > somefile" to get the list of filenames in a directory. Instead, use FindFirstFile() and FindNextFile()
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  5. #20
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    If you type dir at a command line, what do you see? I'm not really sure how you've settled on 128 as the value you're looking for here. Also, there's no such thing as extended ASCII, but there sure are a lot of (inconsistent/incompatible) code pages out there to map values to visible glyphs. So you'd first need to figure out which code page you're on.

  6. #21
    Fountain of knowledge.
    Join Date
    May 2006
    Posts
    794
    I notice now that once I open the file there are problems as the € is also in the file.
    By the time it is processed it comes out as 2 or 3 characters!!

    Not really a huge problem though, I think I can just convert the output.

  7. #22
    Fountain of knowledge.
    Join Date
    May 2006
    Posts
    794
    Quote Originally Posted by brewbuck View Post
    There is not. Read Wikipedia:



    Your problem is that you're using "dir > somefile" to get the list of filenames in a directory. Instead, use FindFirstFile() and FindNextFile()

    Not really the problem is the handling of the € character, it works fine when it is not present.

    I will look at those functions, not sure my djgpp compiler has them.

    There are also problems within the file with the € character.

  8. #23
    Fountain of knowledge.
    Join Date
    May 2006
    Posts
    794
    Quote Originally Posted by tabstop View Post
    If you type dir at a command line, what do you see? I'm not really sure how you've settled on 128 as the value you're looking for here. Also, there's no such thing as extended ASCII, but there sure are a lot of (inconsistent/incompatible) code pages out there to map values to visible glyphs. So you'd first need to figure out which code page you're on.

    Well the output is redirected into a file and it is a '?' or a 63 decimal, I see this in a hex editor.
    So I would see that on the screen.
    I settled on 128 because that is in the ascii character set for €, and it works when I converted it within the program.

  9. #24
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by esbo View Post
    Not really the problem is the handling of the € character, it works fine when it is not present.

    I will look at those functions, not sure my djgpp compiler has them.

    There are also problems within the file with the € character.
    Here's half your problem .... from the DJGPP home page...

    DJGPP is a complete 32-bit C/C++ development system for Intel 80386 (and higher) PCs running DOS.
    Buddy... you're trying to teach table manners to a Dinosaur!

    Really... time to update.

  10. #25
    Fountain of knowledge.
    Join Date
    May 2006
    Posts
    794
    Quote Originally Posted by CommonTater View Post
    Here's half your problem .... from the DJGPP home page...



    Buddy... you're trying to teach table manners to a Dinosaur!

    Really... time to update.

    Well it was the best I could find at the time and has been basically fine for me.

    Also I did not have observe unnecessary pointless and tedious compiler inflexibility.
    (void declarations etc... and other annoyances.)

  11. #26
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by esbo View Post
    Well it was the best I could find at the time and has been basically fine for me.
    Trust me... you have no idea what you are missing.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 05:02 AM
  2. gcc link external library
    By spank in forum C Programming
    Replies: 6
    Last Post: 08-08-2007, 03:44 PM
  3. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  4. inet_aton()... Noob needs help with sockets :|
    By Maz in forum C++ Programming
    Replies: 3
    Last Post: 11-22-2005, 04:33 PM
  5. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 10:46 AM