ICU resource bundling on Linux: error faced while using Key more than 15 chars

Thread Tools Search this Thread
Operating Systems Linux Red Hat ICU resource bundling on Linux: error faced while using Key more than 15 chars
# 1  
Old 05-28-2009
ICU resource bundling on Linux: error faced while using Key more than 15 chars


I am trying to use ICU resource bundle on Unix and created a resource bundle "root.res" from the following file.

root {
abcdefghijklmnop { "16 character key" }
abcdefghijklmno { "15 character key" }
abcdefghijklmn { "14 character key" }
abcdefghijklm12 { "13 C 2 Int" }
abcdefghijklm123 { "13 Char 3 Int" }
abcdefghij123456 { "10 char 6 int" }
ab1234567891012 { "1234567891012" }
abcdefghijklmnopqrstuvwxyz { "Char 26" }

When I use C++ program to fetch these data from the resource file, it throws the below error if key is more than 15 characters
(for example abcdefghijklmnop or abcdefghij123456).

[root@localhost ICU_POC]# ./StringExtern root

Enter the key : abcdefghij123456

Thing using cout = 10 char 6 int ----> output displayed before error.
*** glibc detected *** corrupted double-linked list: 0x087c51b8 ***

Please note it was able to display the value but then threw the error.

If key is less than equal to 15 characters (for example abcdefghijklmno ) , values are fetched properly without errors.

[root@localhost ICU_POC]# ./StringExtern root

Enter the key : abcdefghijklmno

Thing using cout = 15 character key

This problem is seen only on Linux and not on windows. We are able to use keys (more than 16 characters) on Windows without any error.

Does anybody have an idea about this problem? Is this the limitation for Linux or something is wrong in execution?

C++ program:

#include <iostream>
#include "unicode/msgfmt.h"
#include "unicode/resbund.h"
#include "unicode/unistr.h"
#include "unicode/ulocdata.h"
#include "unicode/ustream.h"
#include <wchar.h>

int main(int argc, char* argv[])
   UErrorCode status = U_ZERO_ERROR;

   if ( argc !=2 )
      cout << "Please run the executable in the following format:" << endl;
      cout << "StringExtern <locale code>" << endl;
      cout << "For reference of locale code see" << endl;
      return 0;

   //Setting the default locale passed by the user

   //Initializing  the constructor of the ResourceBundle class which takes two parameters.  //path of the .dat file, status)

   ResourceBundle resourceBundle("/root/Desktop/ICU_POC/myapp",status);
   //Check for the error in reading the .dat file(resource bundle)
      printf("Can't open resource bundle. Error is %s\n", u_errorName(status));
      return 0;

   //Extracting the text corresponding to the text passed to the getStringEx function.

   char *pj=new char();
   cout<<"\nEnter the key : ";

   UnicodeString thing = resourceBundle.getStringEx(pj, status);

   // Check for the error in extractring the text (may not be a valid text)

      printf("Can't find String. Error is %s\n", u_errorName(status));
      return 0;

  cout<<"\nThing using cout = "<<thing<<endl;
   return 0;

Any input or help is appreciated in this regard.

Prashant Jindal
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Red Hat

Linux PaceMaker Equivalent to a SharedAddress Resource Type

In HA platforms, there is the concept of a "Scalable Resource Type, which included the sharedaddress" that is used in commonly Web Servers resource groups. The sharedaddress resource type is provided so a developer can use this Resource type to build their own scalable resource group. I see... (1 Reply)
Discussion started by: mrmurdock
1 Replies

2. UNIX for Beginners Questions & Answers

Shell script to split data with a delimiter having chars and special chars

Hi Team, I have a file a1.txt with data as follows. dfjakjf...asdfkasj</EnableQuotedIDs><SQL><SelectStatement modified='1' type='string'><! The delimiter string: <SelectStatement modified='1' type='string'><! dlm="<SelectStatement modified='1' type='string'><! The above command is... (7 Replies)
Discussion started by: kmanivan82
7 Replies

3. Red Hat

HELP - Resource/Performance Monitoring Script - Red Hat Enterprise Linux Server

Hi all, ------------------------- Linux OS Version/Release: ------------------------- Red Hat Enterprise Linux Server release 5.5 (Tikanga) Linux <hostname> 2.6.18-194.8.1.el5 #1 SMP Wed Jun 23 10:52:51 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux I have a server that hosts 30+ Oracle... (1 Reply)
Discussion started by: newbie_01
1 Replies

4. Shell Programming and Scripting

Issue faced while accessing data from files on different servers.

I have two log files of same name and structure which resides on different servers with ssh-keygen installed. I want to search for a list of strings available in an array on last 15 minutes logs of both files and calculate the total count of occurence of each string. Sample format of both file... (0 Replies)
Discussion started by: poweroflinux
0 Replies

5. Shell Programming and Scripting

find 4 chars on 2nd line, 44 chars over

I know this should be simple, but I've been manning sed awk grep and find and am stupidly stumped :( I'm trying to use sed (or awk, find, etc) to find 4 characters on the second line of a file.txt 44-47 characters in. I can find lots of sed things for lines, but not characters. (4 Replies)
Discussion started by: unclecameron
4 Replies

6. Shell Programming and Scripting

restrict the user not to key in more than 50 chars

When my script is run, it will ask the user to enter some text and the user should be restricted not to enter more than 50 chars. Is there any command which I can use with "read" command? Help me please (18 Replies)
Discussion started by: injeti
18 Replies

7. UNIX for Advanced & Expert Users

restrict the user not to key in more than 50 chars

am looking like something... eg: Input:testing and the cursor should stop after a particular length and not allow user to enter any more chars in shell scripting not awk (1 Reply)
Discussion started by: injeti
1 Replies

8. Linux

ICU Java

Collegues Rendering of my language in Java is not proper. I have created a patch for ICU. How can I integrate the patch to Jdk1.5.0_09 or Jre. Which .so file I have to replace for it . With warm regards jaganadh.G (0 Replies)
Discussion started by: jaganadh
0 Replies

9. Shell Programming and Scripting

How to convert C source from 8bit chars to 16bit chars?

I was using the following bash command inside the emacs compile command to search C++ source code: grep -inr --include='*.h' --include='*.cpp' '"' * | sed "/include/d" | sed "/_T/d" | sed '/^ *\/\//d' | sed '/extern/d' Emacs will then position me in the correct file and at the correct line... (0 Replies)
Discussion started by: siegfried
0 Replies
Login or Register to Ask a Question

Featured Tech Videos