473,785 Members | 2,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1537


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.Exceptio n
Message: The class Rope could not be constructed from the XML.

Details:

* System.Reflecti on.TargetInvoca tionException: Index was out of
range. Must be non-negative and less than the size of the collection.
Parameter name: index
* System.Reflecti on.TargetInvoca tionException: Exception has been
thrown by the target of an invocation.
Source: Simulation
at Simulation.Sess ion.CreateSimul ation(Simulatio nFactory
simulationFacto ry)

Nested Exception

Exception: System.Reflecti on.TargetInvoca tionException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
at
System.Reflecti on.RuntimeConst ructorInfo.Inte rnalInvoke(Bind ingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture,
Boolean isBinderDefault )
at System.Reflecti on.RuntimeConst ructorInfo.Invo ke(BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeT ype.CreateInsta nceImpl(Binding Flags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttri butes)
at System.Activato r.CreateInstanc e(Type type, BindingFlags
bindingAttr, Binder binder, Object[] args, CultureInfo culture,
Object[] activationAttri butes)
at System.Reflecti on.Assembly.Cre ateInstance(Str ing typeName,
Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[]
args, CultureInfo culture, Object[] activationAttri butes)
at Dynamics.BasicP arts.BasicParts Manager.Constru ctChild(String
nameSpace, XmlNode node)

Nested Exception

Exception: System.Argument OutOfRangeExcep tion
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.Collecti ons.ArrayList.g et_Item(Int32 index)
at Dynamics.BasicP arts.Rope.Reset ()
at Dynamics.BasicP arts.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
5220
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 the "problem" lies in the C library implementation of wcsftime()). I'm not sure if this is a platform-dependent feature or part of the C standard. I've compiled with GCC 3.4.3 on GNU/Linux, and run in an en_GB UTF-8
1
2107
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 letters like german umlauts (Ä , Ö ...) that are simply keeped untouched. Everything else (sorting etc.) is working fine and LC_COLLATE, LC_CTYPE and all the other locales were set proper to 'de_AT.UTF-8' (thats how my mandrake-systems calls the...
0
1115
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 can specify an encoding and different locales to be used with that encoding... so you can end up with combinations like this:
6
2749
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 sys.getfilesystemencoding() is "utf-8". However, sys.argv is neither in ASCII (since I can pass French accentuated character), nor in UTF-8. It seems to be encoded in "latin-1", but why ? Jiba
6
3451
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, using setappdefaultencoding and the right encoding for open with styled text control with the right encoding the files. (I see the german Umlauts äöü and the "strong 's'" "ß") The case:
10
4871
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() << endl;
2
3444
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 byte stream returned by strftime () into Unicode. This old bug: http://mail.python.org/pipermail/python-bugs-list/2003- November/020983.html
0
1829
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
3055
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) selected by the user on his machine. Is there any Java utility function or set of function or package, using which, I can somehow figure out my current character set / encoding would support the given locale? Thanks, ~jaideep
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10325
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10091
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.