Raised This Month: $51 Target: $400
 12% 

How to use UTF-8 or specify codepage (-c<name> option of spcomp.exe)?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AngelX
New Member
Join Date: Nov 2007
Location: Russia
Old 05-07-2008 , 13:15   How to use UTF-8 or specify codepage (-c<name> option of spcomp.exe)?
Reply With Quote #1

On Pawn homepage wrote:
Quote:
To suit internationalization and localization, pawn supports Unicode/UCS-4 and UTF-8, as well as codepages. The compiler can convert source code entered in a particular codepage to Unicode; it also supports source code files in UTF-8 format.
Question 1:
I wrote plugin and save it in utf-8 (with 0xEF 0xBB 0xBF in first bytes).
But i can't compile it with error:
Quote:
test.sp(1) : error 010: invalid function or declaration
Why I must delete 0xEF 0xBB 0xBF before compilation?

Question 2:
SourcePawn compiler have -c option
Code:
-c<name> codepage name or number; e.g. 1252 for Windows Latin-1
Is this option for "convert source code entered in a particular codepage to Unicode"?

I find place and format of codepage file in source codes of Pawn compliler.
It's "codepage" directory, and files from http://unicode.org/Public/MAPPINGS/
Is that right?

When i save plugin in cp1251 and compile it with -c1251 i have error
Quote:
error 043: character constant exceeds range for packed string
How use -c option right?

Compiler version is
SourcePawn Compiler 1.1.0.2037
Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2008 AlliedModders, LLC
AngelX is offline
BAILOPAN
Join Date: Jan 2004
Old 05-08-2008 , 01:41   Re: How to use UTF-8 or specify codepage (-c<name> option of spcomp.exe)?
Reply With Quote #2

1) The Pawn compiler probably does not like the BOM bytes (which is a reasonable disliking, as they are useless garbage). If you'd like that fixed you'll need to file a feature request.

2) Don't use alternate code pages. Use normal ASCII or UTF-8
__________________
egg
BAILOPAN 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 00:04.


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