Hello.
strcoll() collates based on LC_COLLATE which is taken from the
environment. Is there a similar function that takes collation as an
argument instead of as an environment? The reason why I ask is what
if I need to use strcoll() in a server that works on behalf of clients
which might have different collation configurations? For instance, in
a database server? Is there any way around strcoll()'s limitation, or
is my thinking just completely wrong here?
Thanks. 4 1962
DaLoverhino wrote, On 30/01/07 17:55:
Hello.
strcoll() collates based on LC_COLLATE which is taken from the
environment. Is there a similar function that takes collation as an
argument instead of as an environment? The reason why I ask is what
if I need to use strcoll() in a server that works on behalf of clients
which might have different collation configurations? For instance, in
a database server? Is there any way around strcoll()'s limitation, or
is my thinking just completely wrong here?
You could call setlocale once you know the appropriate locale for what
you are going to be doing. This has the advantage that it will get a few
other functions to do the right thing.
Depending on how your code is structures you may, of course, need to set
the locale back to the default at some point with another call to setlocale.
--
Flash Gordon
On Jan 30, 1:23 pm, Flash Gordon <s...@flash-gordon.me.ukwrote:
DaLoverhino wrote, On 30/01/07 17:55:
Hello.
strcoll() collates based on LC_COLLATE which is taken from the
environment. Is there a similar function that takes collation as an
argument instead of as an environment? The reason why I ask is what
if I need to use strcoll() in a server that works on behalf of clients
which might have different collation configurations? For instance, in
a database server? Is there any way around strcoll()'s limitation, or
is my thinking just completely wrong here?
You could call setlocale once you know the appropriate locale for what
you are going to be doing. This has the advantage that it will get a few
other functions to do the right thing.
Depending on how your code is structures you may, of course, need to set
the locale back to the default at some point with another call to setlocale.
--
Flash Gordon
Thanks for the information, but I don't think it solves my problem. I
can setlocale(), but that changes the environment but, what if I'm in
a multi-thread environment where each thread might want to have it's
own locale? I can thread sync locale-sensitive operations but that
would be slow and too restrictive.
DaLoverhino wrote, On 30/01/07 19:19:
On Jan 30, 1:23 pm, Flash Gordon <s...@flash-gordon.me.ukwrote:
>DaLoverhino wrote, On 30/01/07 17:55:
>>Hello. strcoll() collates based on LC_COLLATE which is taken from the environment. Is there a similar function that takes collation as an argument instead of as an environment? The reason why I ask is what if I need to use strcoll() in a server that works on behalf of clients which might have different collation configurations? For instance, in a database server? Is there any way around strcoll()'s limitation, or is my thinking just completely wrong here?
You could call setlocale once you know the appropriate locale for what you are going to be doing. This has the advantage that it will get a few other functions to do the right thing.
Depending on how your code is structures you may, of course, need to set the locale back to the default at some point with another call to setlocale. -- Flash Gordon
Please don't quote peoples signatures (the bit after the "-- ") unless
you are commenting on them.
Thanks for the information, but I don't think it solves my problem. I
can setlocale(), but that changes the environment but, what if I'm in
a multi-thread environment where each thread might want to have it's
own locale? I can thread sync locale-sensitive operations but that
would be slow and too restrictive.
If threading is an issue then you need to ask in a group dedicated to
your implementation. The C standard does not specify how setlocale
interacts with threads because it does not mention threads at all.
--
Flash Gordon
DaLoverhino wrote:
Thanks for the information, but I don't think it solves my problem. I
can setlocale(), but that changes the environment but, what if I'm in
a multi-thread environment where each thread might want to have it's
own locale? I can thread sync locale-sensitive operations but that
would be slow and too restrictive.
Threads are not part of the C language. Any issues you have with them
should be discussed in a newsgroup that covers your implementation --
maybe comp.unix.programmer or comp.os.ms-windows.programmer.win32 -- and
given that you are willing to use platform-specific features like
threads, you may find there are other platform-specific functions that
can do string collation with a specified locale.
Or, of course, you could write the whole thing yourself. It's quite a
complicated job if you want to cover all the languages and scripts in
Unicode!
--
Simon. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: domeceo |
last post by:
can anyone tell me why I cannot pass values in a setTimeout function
whenever I use this function it says "menu is undefined" after th
alert.
function imgOff(menu, num) {
if (document.images) {...
|
by: phil_gg04 |
last post by:
Dear Javascript Experts,
Opera seems to have different ideas about the visibility of Javascript
functions than other browsers. For example, if I have this code:
if (1==2) {
function...
|
by: laredotornado |
last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to
have my Javascript function execute from the BODY's "onload" method,
but if there is already an onload method defined, I would...
|
by: sushil |
last post by:
+1 #include<stdio.h>
+2 #include <stdlib.h>
+3 typedef struct
+4 {
+5 unsigned int PID;
+6 unsigned int CID;
+7 } T_ID;
+8
+9 typedef unsigned int (*T_HANDLER)(void);
+10
|
by: Olov Johansson |
last post by:
I just found out that JavaScript 1.5 (I tested this with Firefox 1.0.7
and Konqueror 3.5) has support not only for standard function
definitions, function expressions (lambdas) and Function...
|
by: Beta What |
last post by:
Hello,
I have a question about casting a function pointer. Say I want to make
a generic module (say some ADT implementation) that requires a function
pointer from the 'actual/other modules'...
|
by: f rom |
last post by:
----- Forwarded Message ----
From: Josiah Carlson <jcarlson@uci.edu>
To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org
Sent: Monday, December 4, 2006 10:03:28 PM
Subject: Re: ...
|
by: Larax |
last post by:
Best explanation of my question will be an example, look below at this
simple function:
function SetEventHandler(element)
{
// some operations on element
element.onclick =
function(event)
{
|
by: alex |
last post by:
I am so confused with these three concept,who can explained it?thanks
so much?
e.g.
var f= new Function("x", "y", "return x * y");
function f(x,y){
return x*y
}
var f=function(x,y){
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
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...
| |