This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

can someone convert the c++ code to pawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jacob
Senior Member
Join Date: Oct 2010
Old 11-07-2010 , 01:15   can someone convert the c++ code to pawn
Reply With Quote #1

PHP Code:
#include <winnls.h>   
#include <malloc.h>
   
LPCSTR Utf8toAnsiLPCSTR utf8 )   
{     
  
int WLength MultiByteToWideChar(CP_UTF80utf8, -1NULLNULL );   
  
LPWSTR pszW = (LPWSTR_alloca( (WLength 1) *sizeof(WCHAR) ) ;       
  
MultiByteToWideChar(CP_UTF80utf8, -1pszWWLength );   
  
pszW[WLength] = 0;   
     
  
int ALength WideCharToMultiByte(CP_ACP0pszW, -1NULL0NULLNULL);   
  
LPSTR pszA = ( LPSTR _alloca ALength );   
  
WideCharToMultiByte(CP_ACP0pszW, -1pszAALengthNULLNULL);   
  
pszA[ALength] = 0;   
       
  return 
pszA;   

thanks in advance!
Jacob is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 11-07-2010 , 01:02   Re: can someone convert the c++ code to pawn
Reply With Quote #2

Those are some fucked up variable/class names.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
issen1
Member
Join Date: Jan 2010
Old 11-07-2010 , 04:13   Re: can someone convert the c++ code to pawn
Reply With Quote #3

I think there is no function like WideCharToMultiByte in PAWN. So would have to write a module to convert your string.
__________________
greets (:
issen1 is offline
Vechta
Veteran Member
Join Date: Jun 2010
Old 11-07-2010 , 04:27   Re: can someone convert the c++ code to pawn
Reply With Quote #4

What this code does?
Vechta is offline
Jacob
Senior Member
Join Date: Oct 2010
Old 11-07-2010 , 05:13   Re: can someone convert the c++ code to pawn
Reply With Quote #5

Quote:
Originally Posted by issen1 View Post
I think there is no function like WideCharToMultiByte in PAWN. So would have to write a module to convert your string.
Very correct.do you enough time to help me?

Last edited by Jacob; 11-07-2010 at 05:23.
Jacob is offline
Jacob
Senior Member
Join Date: Oct 2010
Old 11-07-2010 , 05:21   Re: can someone convert this c++ code to pawn
Reply With Quote #6

Quote:
Originally Posted by Vechta View Post
What this code does?
transform utf8 format to ansi.asian countries and some other countries use utf8 format word.
Jacob is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 11-07-2010 , 07:43   Re: can someone convert the c++ code to pawn
Reply With Quote #7

Just save your source file and/or the translation file as UTF-8 without BOM.
Seta00 is offline
Jacob
Senior Member
Join Date: Oct 2010
Old 11-07-2010 , 08:36   Re: can someone convert the c++ code to pawn
Reply With Quote #8

Quote:
Originally Posted by Seta00 View Post
Just save your source file and/or the translation file as UTF-8 without BOM.
no,I kown what you said.if you are in English speaking countries,you may can't understand what's the problem.your method is just fit for such as "print message".if i want the utf8 word sunch as my CSID to show on the scoreboard,then how to solve the problem.
Jacob is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:58.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode