Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : Development : Unicode CFiles
New Topic New Poll Post Reply
Poster Message
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5126
Registered: 02-04-2003
IP: Logged
icon Unicode CFiles (0)  
In my first pass through to port to SGI, I just made CFiles work with standard C++ file access routines, not Unicode (mostly because I couldn\'t find any way to open a Unicode filename). Now I\'m doing the Unicode stuff - I\'m pretty sure I\'ve gotten CFiles converted okay, but then I need to convert everything that uses CFiles.

The problem I\'m having is in CDbBase:: Open() - it used to take a char*, so I converted it to a WCHAR*. But then it calls:
 m_pStorage = new c4_Storage(pwszDatFilepath, true);

c4_Storage doesn\'t have a constructor that takes a WCHAR*. What I think I need do is use the default constructor and then use LoadFrom(c4_Stream& ) - I\'d just have to derive a class from c4_Stream that opens a file with a Unicode filename.

Sound right? Just wanted a little input in case I missed the obvious easier solution.


____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
02-28-2003 at 06:43 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2384
Registered: 02-04-2003
IP: Logged
icon Re: Unicode CFiles (0)  
quote:
Schik wrote:
In my first pass through to port to SGI, I just made CFiles work with standard C++ file access routines, not Unicode (mostly because I couldn\'t find any way to open a Unicode filename). Now I\'m doing the Unicode stuff - I\'m pretty sure I\'ve gotten CFiles converted okay, but then I need to convert everything that uses CFiles.

The problem I\'m having is in CDbBase:: Open() - it used to take a char*, so I converted it to a WCHAR*. But then it calls:
 m_pStorage = new c4_Storage(pwszDatFilepath, true);

c4_Storage doesn\'t have a constructor that takes a WCHAR*. What I think I need do is use the default constructor and then use LoadFrom(c4_Stream& ) - I\'d just have to derive a class from c4_Stream that opens a file with a Unicode filename.

Sound right? Just wanted a little input in case I missed the obvious easier solution.


Jeezus, that sounds like a pain. Sounds like a good solution, though. I haven\'t used LoadFrom() before.

I feel a little guilty because I\'m not sure that unicode filepaths are that important. It seems like a \"nice to have\" feature, but I would think that people avoid using non-ANSI chars in their filepaths because so much software would fail from using it.

But I\'m ignorant on what really happens out there. Like if you install a Chinese version of Windows, does it create a \"Program Files\" directory or does it call it something Chinese with those characters. Does anybody have any experience with this?

-Erik

____________________________
Godkiller Gamedev Sundays (live sessions every Sunday 3pm PST where I make a new puzzle game)
youtube (archive of live streams, and some animated videos I made)
02-28-2003 at 07:19 PM
View Profile Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5126
Registered: 02-04-2003
IP: Logged
icon Re: Re: Unicode CFiles (0)  
quote:
erikh2000 wrote:
But I\'m ignorant on what really happens out there. Like if you install a Chinese version of Windows, does it create a \"Program Files\" directory or does it call it something Chinese with those characters. Does anybody have any experience with this?


I would guess that it still makes a \"Program Files\" directory so as to not break 99% of software. But I think I should go ahead and try to make this work. I install DROD in d:\\games, and if I were chinese, I\'d probably install it in d:\\<some chinese stuff that means games>.

Deriving the class from c4_Stream shouldn\'t be hard - its only methods are Read() and Write(). Add in a constructor that takes a WCHAR* and we\'re talking < 100 lines including comments.

It\'s just that when I saw the \"new c4_Storage(char*)\" call, I was worried that the unicode CFiles modifications needed to be un-done, and I really wasn\'t looking forward to it, since I have so many other un-checked-in changes. I decided to stop & ask before making even more changes that might need un-done.

Long story short - I\'ll give it a shot. :)


____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
02-28-2003 at 07:30 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2384
Registered: 02-04-2003
IP: Logged
icon Re: Re: Re: Unicode CFiles (0)  
quote:
Schik wrote:
It\'s just that when I saw the \"new c4_Storage(char*)\" call, I was worried that the unicode CFiles modifications needed to be un-done, and I really wasn\'t looking forward to it, since I have so many other un-checked-in changes.

Consider checking in some of your other completed work if you are 90% sure that it won\'t break anything. If this sounds useful, just post a diff output for what you would like to check in and I\'ll review it.

Or be monolithic if that\'s the best way.

-Erik


____________________________
Godkiller Gamedev Sundays (live sessions every Sunday 3pm PST where I make a new puzzle game)
youtube (archive of live streams, and some animated videos I made)
02-28-2003 at 08:12 PM
View Profile Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 4458
Registered: 02-04-2003
IP: Logged
icon Re: Re: Unicode CFiles (0)  
quote:
I feel a little guilty because I\'m not sure that unicode filepaths are that important. It seems like a \"nice to have\" feature, but I would think that people avoid using non-ANSI chars in their filepaths because so much software would fail from using it.

But I\'m ignorant on what really happens out there. Like if you install a Chinese version of Windows, does it create a \"Program Files\" directory or does it call it something Chinese with those characters. Does anybody have any experience with this?

-Erik

Yeah, I think it happens a lot. I only have experience with Russian Windows, but it *does* have everything russified. Filenames, dirs, etc. are often in Russian. I think people from countries with other alphabets would be a bit miffed if when they type their filenames, all that happens is typing in English letters. :)

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
03-01-2003 at 03:33 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5126
Registered: 02-04-2003
IP: Logged
icon Re: Re: Re: Re: Unicode CFiles (0)  
quote:
erikh2000 wrote:
Consider checking in some of your other completed work if you are 90% sure that it won\'t break anything. If this sounds useful, just post a diff output for what you would like to check in and I\'ll review it.

Or be monolithic if that\'s the best way.



I would love to check my stuff in soon. Right now, it\'s not quite compiling though. :)

As soon I fix another thing or two (I find it funny that SDL_ttf renders unicode strings, but can\'t load a ttf file with a unicode name) and make sure it\'s all still working on the Win32 side, I\'d be happy to check it in.

The last few days work and other obligations have been kicking my butt, hopefully I\'ll have more DROD time soon.


____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
03-05-2003 at 08:53 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2384
Registered: 02-04-2003
IP: Logged
icon Re: Re: Re: Re: Re: Unicode CFiles (0)  
quote:
Schik wrote:
I would love to check my stuff in soon. Right now, it\'s not quite compiling though. :)

No problem. You can decide when the right time is.

...
quote:
(I find it funny that SDL_ttf renders unicode strings, but can\'t load a ttf file with a unicode name)


Hey, and if you want to mod SDL_ttf to fix that, we can send the patch to good old Sam Latinga and see if he wants to include it.

-Erik


____________________________
Godkiller Gamedev Sundays (live sessions every Sunday 3pm PST where I make a new puzzle game)
youtube (archive of live streams, and some animated videos I made)
03-05-2003 at 08:58 PM
View Profile Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5126
Registered: 02-04-2003
IP: Logged
icon Re: Re: Re: Re: Re: Re: Unicode CFiles (0)  
quote:
erikh2000 wrote:
Hey, and if you want to mod SDL_ttf to fix that, we can send the patch to good old Sam Latinga and see if he wants to include it.



The only bad thing is we\'re using WCHAR\'s, not wchar_t\'s. But then again, perhaps SDL_ttf could be modded to take an open FILE* instead of a filename.


____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
03-05-2003 at 10:54 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : Development : Unicode CFiles
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.