|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
Convert Char String to utf16 format - C++ SolarisHi ,
I am using the following function to convert the input char string to unicode format Chat inputString[10];
UnicodeString* unicode = new UnicodeString(inputString). I think the input string is convert in to unicode format. Now What I need is convert the unicode in to utf16 format. 1. ) Is there a way that I can convert the Char string in to utf16 format in C++ ( gcc )
Thanks in Advance,
------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ icu-support mailing list - icu-support@... To Un/Subscribe: https://lists.sourceforge.net/lists/listinfo/icu-support |
|
|
Re: Convert Char String to utf16 format - C++ SolarisMy understanding is that ICU uses UTF-16 as internal
encoding. See http://www.icu-project.org/userguide/strings.html#strings
------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ icu-support mailing list - icu-support@... To Un/Subscribe: https://lists.sourceforge.net/lists/listinfo/icu-support |
|
|
Re: Convert Char String to utf16 format - C++ SolarisThanks for the reply.
Also after converting the char string to unicode is there a
function to display the unicode to the console
?
------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ icu-support mailing list - icu-support@... To Un/Subscribe: https://lists.sourceforge.net/lists/listinfo/icu-support |
|
|
Re: Convert Char String to utf16 format - C++ SolarisThe code snippet you showed will work because of a
"feature" recently discussed whereby the constructor of the UnicodeString
class will use the default system code page to "widen" the "narrow" string AND
because the data you gave in the example is Ansi and the default code page (on
most people's systems) will likely "widen" that string correctly to
Unicode.
However, if you are using a non-Standard encoding
for the text (e.g. anything non-Roman/Ansi/Ascii) OR if your default system code
page on a user's machine is not the same as the encoding of the data, then this
won't work.
You need to clearly separate in your mind the
conversion from "narrow to wide" (which is happening by virtue of the
UnicodeString constructor for narrow strings and which uses the default system
code page) and the conversion from some encoding to Unicode (or UTF-16 as you
call it).
For the data you showed (i.e. "test"), those two
conversion are probably the same; but that may not always true depending on
the encoding of your data.
Bob
------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ icu-support mailing list - icu-support@... To Un/Subscribe: https://lists.sourceforge.net/lists/listinfo/icu-support |
|
|
Changing translit filesAre transliterator tables compiled into the ICU
DLLs or is it possible to modify them after installation?
A colleague needs to modify one of the
transliteration tables in data\translit folder *after* ICU has been installed on
his machine.
He says that changes he's made to the files are not
being reflected by calls to the corresponding transliterator...
Thanks,
Bob
------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ icu-support mailing list - icu-support@... To Un/Subscribe: https://lists.sourceforge.net/lists/listinfo/icu-support |
|
|
Re: Changing translit filesIf you've compiled ICU to use a .dat archive or individual data files, you
can modify ICU's data after installation. This is done with --with-data-packaging=archive and --with-data-packaging=files respectively. Since you mention DLLs, I presume this is Windows. You can use the Cygwin/MSVC configuration to get that configuration for the data easily. You can also do this through the standard project files, but it's a little more difficult because it requires a little more knowledge about how ICU is built. The .dat archive can be modified in its installed location with icupkg. If you compile ICU's data into a DLL or a static library, the files can't be changed after the installation, unless you rebuild the data and reinstall a brand new data DLL. More details on packaging ICU's data can be found at: http://icu-project.org/userguide/icudata.html George Rhoten IBM Globalization Center of Competency/ICU San José, CA, USA http://www.icu-project.org/ "Bob Eaton" <pete_dembrowski@...> Sent by: icu-support-bounces@... 05/11/2007 03:37 AM Please respond to ICU support mailing list <icu-support@...> To "ICU support mailing list" <icu-support@...> cc Subject [icu-support] Changing translit files Are transliterator tables compiled into the ICU DLLs or is it possible to modify them after installation? A colleague needs to modify one of the transliteration tables in data\translit folder *after* ICU has been installed on his machine. He says that changes he's made to the files are not being reflected by calls to the corresponding transliterator... Thanks, Bob ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ icu-support mailing list - icu-support@... To Un/Subscribe: https://lists.sourceforge.net/lists/listinfo/icu-support |
| Free embeddable forum powered by Nabble | Forum Help |