473,219 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,219 software developers and data experts.

Reading unicode (utf-16 le) using wifstream

Heay, i've got this problem:


i'm using wifstream to read utf-16 file and i've got this problem, that
each byte is read into seperate char while little-endian uses at least
2 bytes for one sign.

the code of method is in the above letter, also with the problem i'm
attaching below:
i've googled and browsed documentation, but can't make it out by my
own. :(

- subgroup {"?yH} std::basic_string<wchar_t,std::char_traits<wchar_t >,std::allocator<wchar_t>
+ std::_String_val<wchar_t,std::allocator<wchar_t> > {_Alval={...}
} std::_String_val<wchar_t,std::allocator<wchar_t> >
- _Bx {_Buf=0x0012f340 "쀰7H" _Ptr=0x0037c030 "H"
} std::basic_string<wchar_t,std::char_traits<wchar_t >,std::allocator<wchar_t>::_Bxty

- _Buf 0x0012f340 "쀰7H" wchar_t [8]
[0] 49200 '쀰' wchar_t
[1] 55 '7' wchar_t
[2] 72 'H' wchar_t
[3] 0 wchar_t
[4] 101 'e' wchar_t
[5] 0 wchar_t
[6] 108 'l' wchar_t
[7] 0 wchar_t
- _Ptr 0x0037c030 "H" wchar_t *
254 '' wchar_t
_Mysize 12 unsigned int
_Myres 15 unsigned int


Mar 21 '06 #1
2 8721
Hi "Anubis",
i'm using wifstream to read utf-16 file and i've got this
problem, that each byte is read into seperate char while
little-endian uses at least 2 bytes for one sign.

PJ Plauger wrote a pair of columns in the April and May 1999
editions of the C/C++ Users Journal about reading/writing
Unicode files. He uses Codecvt facets to do the conversion.
You can find the source code on the cuj server:


If you are using Windows/Visual C++ the following link
might also be useful:

Best regards,
Mar 21 '06 #2
Thx man, i'll check those links and post my results.

Mar 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Bernd Lambertz | last post by:
I have a problem with bcp and format files. We changed our databases from varchar to nvarchar to support unicode. No problems so fare with that. It is working fine. But now I need a format...
by: Daman | last post by:
Hi, I am currently facing difficulty displaying chinese, japanese, russian etc. characters. I am using VB 6 and ADO to query the DB2 Version 7.2 unicode database (UTF-8). The resultset that...
by: Jamie | last post by:
I have a file that was written using Java and the file has unicode strings. What is the best way to deal with these in C? The file definition reads: Data Field Description CHAR File...
by: Pascal Polleunus | last post by:
Hi, I need to synchronize some tables from a database (master) to another one (slave). Both servers are running Debian Woody with PostgreSQL 7.2.1 (postgresql 7.2.1-2woody4). The databases are...
by: aurora | last post by:
I have some unicode string with some characters encode using python notation like '\n' for LF. I need to convert that to the actual LF character. There is a 'unicode_escape' codec that seems to...
by: Wx | last post by:
Hello. I'm trying to read a textfile written by the NTBackup utility on Windows 2003 SBS. The problem is that when i print the output, it looks like this: S t a t o : b a c k u p O p e r a...
by: s13khan | last post by:
Hi, I'm using FCKEditor for my CMS based web site thru which I save my site data in HTML format and the site is developped using ASP and MS ACCESS as backend. So far the site was of single...
by: John Ztwin | last post by:
Hello, I have a file that contains ordinary text and some special charaters in Unicode escape sequences (\uxxxx). When I read the file using e.g. StreamReader Unicode escape sequences are not...
by: amollokhande1 | last post by:
Hi All, I am using Sql server 2005 as a backend for my application. I want to read/write the unicode data using sql query. When I am using insert into UnicodeData values('سي') command and...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.