Path separator symbol -- is "\" universal?

Just starting out? Need help? Post your questions and find answers here.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Path separator symbol -- is "\" universal?

Post by PB »

Would this work on a Japanse version of Windows?

Code: Select all

If CreateFile(0,"C:\Program Files\test.txt")
  WriteStringN("hello")
  CloseFile(0)
EndIf
Reason for asking: I've just seen a screenshot of a Japanese app, and the
backslash symbol is replaced with a yen symbol, like so:

Code: Select all

C:¥Program Files¥test.txt
So does this mean we can't use a backslash in our apps if our app is going
to be used by the Japanese? Is there a locale setting that will return the
correct path separator character? Thanks for any advice on this.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
dmoc
Enthusiast
Enthusiast
Posts: 739
Joined: Sat Apr 26, 2003 12:40 am

Post by dmoc »

If anything I would have thought / is more universal (although poss not for w98)
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

DON'T USE FIXED SYSTEM-PATH.

On My sytem this folder is called "C:\Programme\". There exist routines for this (search in the forum or in www.purearea.net )
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

Problem is if he has files in a data dir, he cant write "\data\image.bmp", if the backslash is replaced.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> DON'T USE FIXED SYSTEM-PATH

I'm not. I just want to know if a backslash will work on a Japanese system
when specifying ANY path. This topic is not about relative/absolute paths.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

i think it will, didn't we have japanese users who can confirm this?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
NetSlayer
New User
New User
Posts: 4
Joined: Mon Nov 15, 2004 4:25 pm
Location: Germany
Contact:

Post by NetSlayer »

It has to work. Every Windows application uses the backslash.
If it didn't work the Japanese could only use applications made by Japanese people.

Maybe it is not displayed as "\" but internally it has to be "\".
Regards, NetSlayer
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

MSDN:
Q: Can international product developers expect the backslash and colon
hex code points in file paths to be the same all over the world?
I understand the backslash is the yen symbol in Japan, but the hex code
point works OK as the file path separator. Can the user configure the file
path separator?

A: Character 0x5c is always the directory delimiter, no matter what glyph
it is associated with in a particular code page (for example, the Yen
symbol in the Japanese code page). It's not user-configurable.
El_Choni
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> A: Character 0x5c is always the directory delimiter, no matter what glyph
> it is associated with in a particular code page (for example, the Yen
> symbol in the Japanese code page). It's not user-configurable.

Thanks, El_Choni -- that solves the matter once-and-for-all. :)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

thefool wrote:Problem is if he has files in a data dir, he cant write "\data\image.bmp", if the backslash is replaced.
I found that on windows / or \ work the same, but on Linux use / because you'll get an error!
Post Reply