Off Topic possibly

  • Thread starter Thread starter Jack Russell
  • Start date Start date
J

Jack Russell

I use comma delimited strings in data files.

If I set my computer region/ culture to Spanish / Argentina the decimal
character and the list separator are both set to "'" (comma.

This makes decoding the strings almost impossible in certain cases.

Anyone know if this is really rue for that locale or is it an XP bug.
Where would be the right forum to get an answer to this.

Thanks

Jack Russell
 
Jack Russell said:
I use comma delimited strings in data files.

If I set my computer region/ culture to Spanish / Argentina the
decimal character and the list separator are both set to "'" (comma.

This makes decoding the strings almost impossible in certain cases.

Why? What is the problem? Is the "'" also used as the quoting character for
strings? If it is, it's already wrong how the file is written. Do you write
the file on your own or don't you have an influence on the format?
Anyone know if this is really rue for that locale or is it an XP
bug. Where would be the right forum to get an answer to this.

Even if off-topic you can put the subject into the subject line. :-)


Armin
 
It is a comma not an apostrophe

So does the string 1,2,3 represent 1.2, 3 or 1,2.3 or 1,2,3?
 
Thanks I do all that and it works fine if the decimal and separator
characters are different. However you have to break the comma delimited
string up first.

so does 1,2,3 represent 1,2.3 or 1.2,3 or even 1,2,3?

Thanks anyway

Jack Russell
 
Armin said:
In some cases I write it and I agree that I could control that. However
they also type in formulae in the English form part of which would be

Formula(1.2,3)

However presumably, if XP is right then in their locale they would type

Formula (1,2,3) which is undecipherable.

I am trying to find out what they actually do in this case (according to
XP that is the standard for Spanish in the whole American continent
(North and south) but not in Spain. I find it a bit hard to believe.
 
Jack Russell said:
In some cases I write it and I agree that I could control that.
However they also type in formulae in the English form part of which
would be

Formula(1.2,3)

However presumably, if XP is right then in their locale they would
type

Formula (1,2,3) which is undecipherable.

I am trying to find out what they actually do in this case
(according to XP that is the standard for Spanish in the whole
American continent (North and south) but not in Spain. I find it a
bit hard to believe.

I don't understand. *Where* is this written?


I'd say, write to the file in the English format and it will be unambiguous.
You can format it by passing the NumberFormatInfo object to the number's
ToString method. You get that object from
System.Globalization.CultureInfo.InvariantCulture.NumberFormat


Armin
 
when i went international with programming , a long long time ago when
..Net was not yet invented :-)
i choose Tab (blabla blabla) delimited or pipe (blabla|blabla )
delimited formats

for these situations 1,2,3 was it 1.23 or 12.3 or 1 and 2.3 or 1.2
and 3 etc etc etc is simply no solution if you can`t enforce / asume
region / culture settings

so you should write deliver your data in a global way , ever thought about
a lightweight database ? ( sql server everywhere for instance )

regards

Michel
 
Michel,

Trouble is the client does not want to change the software just for this
instance. It seems strange to me that "Spanish America" has these
contradictory settings.

So, the client wants me to warn if the settings conflict and let the end
user sort it out!

However thanks for your suggestions, if I ever do another project like
this I will take them on board.

Jack
 
Jack,

As far as I know is the standard string seperation character for all non
English European languages the ";".

For the rest are the cultures setting doing all the work.

I don't know how the decimal seperator is showed up in things as
intelligence in your IDE. In my English IDE the comma separator is showed as
a dot while for output that is translated to a comma, while my culture
settings are Dutch.

Cor
 
Well wait untill you must write programs for the Netherlands , where the
decimal seperator is a ',' but every person is using a US keyboard if you
then have to write data entry applications on numeric fields you get the
funny situation that a "." is entered by the user when he actually expects a
"," although he hitted the "." key on the numeric pad , and this is in the
Netherlands wrong , when we did some investigation we noticed that all MS
products ( calculator , office etc etc ) simply check the settings and if
needed change the "." to a "," so on the fly we simply change the numeric
"." to a "," when pressed :-)

You could do the same thing i guess when your program exports data just
change the lisseperator to another value if it is a "," however this will
not solve the issue when a user wants to import a file with "," seperated
columns and numeric fractional digits

HTH

Michel
 
Michel,

I did some test with excel and it seeks to force the list separator to
semi colon if the decimal separator is comma.

My client asked one of his employees who is Venezuelan how it worked
with the decimal and list separators being both comma and his reply was
"if the software does not work we set our PC to US English!"

I like your translating the input character idea but am still confused
if the American Spanish expect both decimal and list to be comma how do
I know which he meant to hit!



Jack
 
Cor said:
Jack,

As far as I know is the standard string seperation character for all non
English European languages the ";".

For the rest are the cultures setting doing all the work.

I don't know how the decimal seperator is showed up in things as
intelligence in your IDE. In my English IDE the comma separator is
showed as a dot while for output that is translated to a comma, while my
culture settings are Dutch.

Cor
Good to hear from you Col. take a look in any American Spanish language
in Regional settings under XP or Vista and you will see the list
separator is a comma.(,). I am convinced this a Microsoft "mistake" but ....

And thanks for saying it was not Off Topic!

Jack Russell
 
Well just as i thought exactly the same behavior as with my dot vs comma
problem

if you set

Imports System.Globalization

and then compare these 2 values

NumberFormatInfo.CurrentInfo.NumberDecimalSeperator

CultureInfo.CurrentCulture.Textinfo.ListSeperator

you could check if they are the same and so acordingly take your own list
seperator
this way you mimick the behavior of Microsoft products as Excel

i guess this is much safer as depending on your users to have and hold the
correct cultureinfo

regards

Michel


Jack Russell said:
Michel,

I did some test with excel and it seeks to force the list separator to
semi colon if the decimal separator is comma.

My client asked one of his employees who is Venezuelan how it worked
with the decimal and list separators being both comma and his reply was
"if the software does not work we set our PC to US English!"

I like your translating the input character idea but am still confused
if the American Spanish expect both decimal and list to be comma how do
I know which he meant to hit!



Jack


Well wait untill you must write programs for the Netherlands , where the
decimal seperator is a ',' but every person is using a US keyboard if you
then have to write data entry applications on numeric fields you get the
funny situation that a "." is entered by the user when he actually expects a
"," although he hitted the "." key on the numeric pad , and this is in the
Netherlands wrong , when we did some investigation we noticed that all MS
products ( calculator , office etc etc ) simply check the settings and if
needed change the "." to a "," so on the fly we simply change the numeric
"." to a "," when pressed :-)

You could do the same thing i guess when your program exports data just
change the lisseperator to another value if it is a "," however this will
not solve the issue when a user wants to import a file with "," seperated
columns and numeric fractional digits

HTH

Michel


Michel,

Trouble is the client does not want to change the software just for this
instance. It seems strange to me that "Spanish America" has these
contradictory settings.

So, the client wants me to warn if the settings conflict and let the end
user sort it out!

However thanks for your suggestions, if I ever do another project like
this I will take them on board.

Jack

Michel Posseth [MCP] wrote:

when i went international with programming , a long long time ago when
..Net was not yet invented :-)
i choose Tab (blabla blabla) delimited or pipe (blabla|blabla )
delimited formats

for these situations 1,2,3 was it 1.23 or 12.3 or 1 and 2.3 or 1.2
and 3 etc etc etc is simply no solution if you can`t enforce / asume
region / culture settings

so you should write deliver your data in a global way , ever thought
about a lightweight database ? ( sql server everywhere for instance )

regards

Michel


"Jack Russell" <[email protected]> schreef in bericht


I use comma delimited strings in data files.

If I set my computer region/ culture to Spanish / Argentina the decimal
character and the list separator are both set to "'" (comma.

This makes decoding the strings almost impossible in certain cases.

Anyone know if this is really rue for that locale or is it an XP bug.
Where would be the right forum to get an answer to this.

Thanks

Jack Russell
 
While my client makes his mind up I have put a warning in the program
"decimal and separator characters identical, please adjust regional
settings ......."

Jack



M. Posseth said:
Well just as i thought exactly the same behavior as with my dot vs comma
problem

if you set

Imports System.Globalization

and then compare these 2 values

NumberFormatInfo.CurrentInfo.NumberDecimalSeperator

CultureInfo.CurrentCulture.Textinfo.ListSeperator

you could check if they are the same and so acordingly take your own list
seperator
this way you mimick the behavior of Microsoft products as Excel

i guess this is much safer as depending on your users to have and hold the
correct cultureinfo

regards

Michel


:

Michel,

I did some test with excel and it seeks to force the list separator to
semi colon if the decimal separator is comma.

My client asked one of his employees who is Venezuelan how it worked
with the decimal and list separators being both comma and his reply was
"if the software does not work we set our PC to US English!"

I like your translating the input character idea but am still confused
if the American Spanish expect both decimal and list to be comma how do
I know which he meant to hit!



Jack


Well wait untill you must write programs for the Netherlands , where the
decimal seperator is a ',' but every person is using a US keyboard if you
then have to write data entry applications on numeric fields you get the
funny situation that a "." is entered by the user when he actually expects a
"," although he hitted the "." key on the numeric pad , and this is in the
Netherlands wrong , when we did some investigation we noticed that all MS
products ( calculator , office etc etc ) simply check the settings and if
needed change the "." to a "," so on the fly we simply change the numeric
"." to a "," when pressed :-)

You could do the same thing i guess when your program exports data just
change the lisseperator to another value if it is a "," however this will
not solve the issue when a user wants to import a file with "," seperated
columns and numeric fractional digits

HTH

Michel


"Jack Russell" <[email protected]> schreef in bericht


Michel,

Trouble is the client does not want to change the software just for this
instance. It seems strange to me that "Spanish America" has these
contradictory settings.

So, the client wants me to warn if the settings conflict and let the end
user sort it out!

However thanks for your suggestions, if I ever do another project like
this I will take them on board.

Jack

Michel Posseth [MCP] wrote:


when i went international with programming , a long long time ago when
..Net was not yet invented :-)
i choose Tab (blabla blabla) delimited or pipe (blabla|blabla )
delimited formats

for these situations 1,2,3 was it 1.23 or 12.3 or 1 and 2.3 or 1.2
and 3 etc etc etc is simply no solution if you can`t enforce / asume
region / culture settings

so you should write deliver your data in a global way , ever thought
about a lightweight database ? ( sql server everywhere for instance )

regards

Michel


"Jack Russell" <[email protected]> schreef in bericht



I use comma delimited strings in data files.

If I set my computer region/ culture to Spanish / Argentina the decimal
character and the list separator are both set to "'" (comma.

This makes decoding the strings almost impossible in certain cases.

Anyone know if this is really rue for that locale or is it an XP bug.
Where would be the right forum to get an answer to this.

Thanks

Jack Russell
 
Back
Top