i use std::getling to read a line in unicoude file to buffer,like:
WCHAR buf[100]
wifstream in;
std::getling(buf,in,100);
but i can't get the right result,it seems can only read by 1 byte;e.g first
word of unicode file is "0xfffe" ,if use getline ,it may 0x00ff 0x00fe in my
buffer
do you have any idea,except use c lib like fgetws 2 1960
aGAric wrote: i use std::getling to read a line in unicoude file to buffer,like: WCHAR buf[100] wifstream in; std::getling(buf,in,100);
but i can't get the right result,it seems can only read by 1 byte;e.g first word of unicode file is "0xfffe" ,if use getline ,it may 0x00ff 0x00fe in my buffer
do you have any idea,except use c lib like fgetws
aGAric:
It would be nice if you would post a typo-free (preferably compilable)
example, so we could tell what you really did.
But, for starters, std::getline does not take a buffer; it takes a string.
HTH,
David Wilkinson
Dear Wilkinson,
thank you for you advice.
i am a new programmer.
"David Wilkinson" <no******@effisols.com>
??????:uC**************@TK2MSFTNGP14.phx.gbl... aGAric wrote:
i use std::getling to read a line in unicoude file to buffer,like: WCHAR buf[100] wifstream in; std::getling(buf,in,100);
but i can't get the right result,it seems can only read by 1 byte;e.g
first word of unicode file is "0xfffe" ,if use getline ,it may 0x00ff 0x00fe
in my buffer
do you have any idea,except use c lib like fgetws
aGAric:
It would be nice if you would post a typo-free (preferably compilable) example, so we could tell what you really did.
But, for starters, std::getline does not take a buffer; it takes a string.
HTH,
David Wilkinson This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Denis Petronenko |
last post by:
Hello,
how can i read into strings from ifstream?
file contains values in following format:
value11; val ue12; value 13;
valu e21;value22; value23;
etc.
i need to read like file >string,...
|
by: Chen shuSheng |
last post by:
I have a code:
---------------------------
#include <iostream.h \\ where I assume getline() is inner.
#include <stdlib.h>
int main()
{ int max=15;
char line;
getline(line,max);...
|
by: Robin |
last post by:
// Pls note that test.txt exists.
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
fstream fs("test.txt", ios_base::in | ios_base::app);
|
by: =?Utf-8?B?Y2xlb2ht?= |
last post by:
Hi,
I have a C++ application that calls a function in another static library
which accepts a std::string parameter. However, my VS 2005 compiler shows
the following error:
...
|
by: Ziyan |
last post by:
I am writing a C/C++ program that runs in background (Linux).
Therefore, normally no output would be written into standard output.
However, sometimes I want to have debug message collected and sent...
| |
by: bryant058 |
last post by:
#include<iostream>
#include<cstring>
#include<string>
#include<iomanip>
using namespace std;
int main()
{
string s;
char *tokenptr;
int space;
|
by: waltbrad |
last post by:
Hello. I'm studying the book "C++ Primer Plus" by Stephan Prata. In
chapter 6 he gives an exercise that reads from a file. The list is
thus:
4
Sam Stone
2000
Freida Flass
100500
Tammy...
|
by: caoliangbj |
last post by:
Hi,
When I capture the SIGINT event, I encounter a probelm.
Please look at the following code, if you don't press any key, the
'getline()' will block there all the time.
When I press...
|
by: Juha Nieminen |
last post by:
I assume that using '\n' to print a newline is not portable because in
some systems newline consists actually of two characters and '\n' is
only one. Thus the only portable way of printing a...
|
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: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |