473,387 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

problems with encoding for different locales

Hi,
I am trying to characterise a problem I am seeing on our C#/C++ xml
driven application. We have recently added some basic Spanish language
support to our application, but it seems that there is an issue with
certain locale settings.

Under Regional and Language Options -Standards and Formats I would
normally change the applications language by selecting Spanish (Mexico).
It looks like the application ignores the Location field.

However if I set the Standards and Formats drop-down to Spanish (Chile),
the application raises an exception when processing the XML data, as
it is suddenly getting out of range values.

What is the difference between these two locales?
After some further testing I noticed that about half the Spanish
language locales will work fine and the other half will give the exception.

All the xml is encoded UTF-8.
I suspect that some Spanish locales require greater than UTF-8 support.

Would encoding to Windows-1252 help possibly?

Any help, info, or pointers are appreciated :)
Thanks

Josh
Jul 4 '06 #1
3 1514


Joshua Stewart wrote:

However if I set the Standards and Formats drop-down to Spanish (Chile),
the application raises an exception when processing the XML data, as it
is suddenly getting out of range values.
All the xml is encoded UTF-8.
What kind of XML API do you use exactly? Which error do you get exactly?
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jul 4 '06 #2
Aek
Martin Honnen wrote:
What kind of XML API do you use exactly? Which error do you get exactly?
We are using C# reflection to create objects from the XML. We are using
C# XML features.
Here is the exception being raised .
I am keen to understand what the differences are between these two
locales (and other Spanish locales).
I only get the exception below on certain Spanish locales.. some work,
some dont.

================================================== ===========

Nested Exception

Exception: System.Exception
Message: The class Rope could not be constructed from the XML.

Details:

* System.Reflection.TargetInvocationException: Index was out of
range. Must be non-negative and less than the size of the collection.
Parameter name: index
* System.Reflection.TargetInvocationException: Exception has been
thrown by the target of an invocation.
Source: Simulation
at Simulation.Session.CreateSimulation(SimulationFact ory
simulationFactory)

Nested Exception

Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
at
System.Reflection.RuntimeConstructorInfo.InternalI nvoke(BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture,
Boolean isBinderDefault)
at System.Reflection.RuntimeConstructorInfo.Invoke(Bi ndingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags
bindingAttr, Binder binder, Object[] args, CultureInfo culture,
Object[] activationAttributes)
at System.Reflection.Assembly.CreateInstance(String typeName,
Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[]
args, CultureInfo culture, Object[] activationAttributes)
at Dynamics.BasicParts.BasicPartsManager.ConstructChi ld(String
nameSpace, XmlNode node)

Nested Exception

Exception: System.ArgumentOutOfRangeException
Message: Index was out of range. Must be non-negative and less than
the size of the collection.
Parameter name: index
Source: mscorlib
at System.Collections.ArrayList.get_Item(Int32 index)
at Dynamics.BasicParts.Rope.Reset()
at Dynamics.BasicParts.Rope..ctor(XmlNode xmlNode, TickableGroup
parent)

================================================== ====

Thanks for your reply,

Josh

Jul 5 '06 #3
Aek
The problem ended up being calls to Convert intead of XmlConvert (as
well as some tricky directx problems)
here is some further dicussion on it
http://groups.google.com.au/group/mi...eadb09afa56df2

cheers

Jul 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Roger Leigh | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The program listed below demonstrates the use of wcsftime() and std::time_put<wchar_t> which is a C++ wrapper around it. (I know this isn't C; but...
1
by: peter pilsl | last post by:
postgres 7.4 on linux, glibc 2.2.4-6 I've a table containing unicode-data and the lower()-function does not work proper. While it lowers standard letters like A->a,B->b ... it fails on special...
0
by: Jaime Casanova | last post by:
Hi all, i want to develop a feature in a c program and need some help... the context: a problem that comes over an over with postgresql database is that when you initialize the cluster you...
6
by: Jiba | last post by:
Hi all, I am desperately searching for the encoding of sys.argv. I use a Linux box, with French UTF-8 locales and an UTF-8 filesystem. sys.getdefaultencoding() is "ascii" and...
6
by: Franz Steinhaeusler | last post by:
Hello NG, a little longer question, I'm working on our project DrPython and try fix bugs in Linux, (on windows, it works very good now with latin-1 encoding). On Windows, it works good now,...
10
by: v4vijayakumar | last post by:
1. why the following program is not working as expected? #include <iostream> using namespace std; int main() { string t("test"); wcout << (wchar_t *) t.c_str() << endl; wcout << t.c_str()...
2
by: Giovanni Bajo | last post by:
Hello, I am trying to find a good way to portably get the output of strftime() and put it onto a dialog (I'm using PyQt, but it doesn't really matter). The problem is that I need to decode the...
0
by: Michele | last post by:
Hi there, I'm using a python script in conjunction with a JPype, to run java classes. So, here's the code: from jpype import * import os import random import math import sys
2
by: jaibarde | last post by:
Hi, I have a need to show list of locales into a field on a wizard ( a Java based application). But these locales should be such that they are supported by the current character set (encoding)...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.