ACE_TAO icon indicating copy to clipboard operation
ACE_TAO copied to clipboard

ACE iconv conversion method not working in linux

Open gadh opened this issue 6 years ago • 1 comments

Version

6.5.5

Host machine and operating system

intel x86_64 cpu, Linux x64, CentOS 7.5

Target machine and operating system (if different from host)

same

Compiler name and version (including patch level)

g++ 4.8.2 (native)

The $ACE_ROOT/ace/config.h file

#include "ace/config-linux.h" #define ACE_HAS_STANDARD_CPP_LIBRARY 1 #define ACE_HAS_WCHAR #define ACE_USES_WCHAR

#define ACE_HAS_ICONV

The $ACE_ROOT/include/makeinclude/platform_macros.GNU file

include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU no_hidden_visibility = 1 CCFLAGS:=$(filter-out -fvisibility=hidden,$(CCFLAGS)) CCFLAGS:=$(filter-out -fvisibility-inlines-hidden,$(CCFLAGS))

The problem effects:

every language other than english in linux systems

Synopsis

ACE iconv conversion method not working in linux

Description

ACE_TString - convert from default encoding in linux (empty str = UTF-8 as stated in locale cmd) to UTF-32 (which is wchar_t) when the conversion fails - the ACE code defaults to simply adding trailing zeroes - i want iconv to not fail...

Repeat by

use ACE_TString in linux with non-english chars as input (read from xml for example)

Sample fix/ workaround

when you set the from-encoding in the ACE code of iconv_open to UTF-8 instead of empty string (i also recommend to change the "hr" variable there from size_t to signed int - in order to easily check for errors (<0)

gadh avatar Oct 30 '19 14:10 gadh

Please open a PR with proposed changes

jwillemsen avatar Nov 03 '19 17:11 jwillemsen