Hello Everybody,
I am having a problem with converting value from multibyte to widechar input variable is data
output variable is data_m -
#define CP_SHIFT_JIS 932
-
-
-
wchar_t *data_m;
-
data_m=(wchar_t*)malloc(sizeof(wchar_t)*1024);
-
memset(data_m, 0, sizeof(wchar_t)*1024);
-
MultiByteToWideChar(CP_SHIFT_JIS,0,data,-1,data_m,0);
-
Sample Input: -
HTTP/1.1 200 OK
-
Date: Wed, 13 Jan 2010 07:34:33 GMT
-
Server: Apache/2.2.3 (Win32) PHP/5.2.0
-
X-Powered-By: PHP/5.2.0
-
Content-Length: 10
-
Connection: close
-
Content-Type: text/html
-
-
Ž„<br>“c’¬
-
i was expecting output from the above code and value is -
HTTP/1.1 200 OK
-
Date: Wed, 13 Jan 2010 07:34:33 GMT
-
Server: Apache/2.2.3 (Win32) PHP/5.2.0
-
X-Powered-By: PHP/5.2.0
-
Content-Length: 10
-
Connection: close
-
Content-Type: text/html
-
-
私<br>田町
-
Let me know what am I missing....
Help is always appreciated.
regards,
Johny
1 4116
Hello,
I solved the problem reading from a Japanese site. The code should be something like that -
wchar_t *data_m;
-
-
int unilen = MultiByteToWideChar(CP_SHIFT_JIS, 0, data, -1, NULL, 0);
-
if (unilen <= 0) {
-
MessageBox(ghwnd,L"Error: charconv_win32: conversion error?\n",L"Error",MB_OK);
-
-
}
-
if (unilen > UNICODE_BUFFER_SIZE) {
-
MessageBox(ghwnd,L"Error: charconv_win32: unicode buffer size Exited",L"Error",MB_OK);
-
}
-
/* convert source string to unicode */
-
data_m=(wchar_t*)malloc(unilen);
-
MultiByteToWideChar(CP_SHIFT_JIS, 0, data, -1, data_m, unilen);
-
regard,
johny
Sign in to post your reply or Sign up for a free account.
Similar topics
by: lian |
last post by:
Hi all,
I want to write some UTF-8 Chinese characters to file with following
php codes:
<code>
.......
$fp = fopen($filepath,'wb');
fwrite($fp,$utf8string,strlen($utf8string));
fclose($fp);...
|
by: Ma Siva Kumar |
last post by:
Running postgresql-7.3.2-3 which came with Red Hat 9.0.
Created a database with unicode encoding (in psql) as below:
create database leatherlink with encoding='unicode' template=leatherlinkdb;...
|
by: Zygmunt Krynicki |
last post by:
Hello
I've browsed the FAQ but apparently it lacks any questions concenring wide
character strings. I'd like to calculate the length of a multibyte string
without converting the whole string.
...
|
by: yazan jab |
last post by:
Is it true that
Multibyte characters are : char arrays (witch represent a string from
the basic characters set). In this case Wide characters are the way
for encoding characters from the...
|
by: Weiping |
last post by:
Hi,
while upgrade to 8.0 (beta3) we got some problem:
we have a database which encoding is UNICODE,
when we do queries like:
select upper('ÖÐÎÄ'); --select some multibyte character,
then...
|
by: Karthik |
last post by:
Hello!
I am not a wizard in this area! Just need some help out in this. I am
trying to convert bstr string to new character string. Here is the
snippet of my code.
**** Code Start****
...
|
by: Marcel Ruff |
last post by:
Hi,
i have the question on how to determine the
string length of a wide string and a multibyte string:
1. Number of letters (one letter may use three bytes)
2. Number of bytes
In the code...
|
by: TK |
last post by:
Hi,
how can I handle multibyte characters like ä, ü (german vowel mutation)?
This does't work:
switch(c)
case 'ä':
... some action
|
by: George2 |
last post by:
Hello everyone,
I need to know the wide character (unicode) and multibyte (UTF-8) values of a character string of czech. I personally know nothing about czech. Is the following approach correct?...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |