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

Special characters in print to chat from console.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ellie
Senior Member
Join Date: Apr 2013
Old 01-30-2014 , 14:20   Special characters in print to chat from console.
Reply With Quote #1

Is there a way to have special characters printed to chat from a CFG file?

Basically what I'm trying to do is this, have some CFG files on server with sm_say "message here" that contains special characters. Something like this in a CFG:

Code:
sm_say "Welcome all fans of ❤Hello Kitty❤"
The problem is that it prints the message, but stops right before the first special character. So all people see is this:

Code:
(ALL) Console: Welcome all fans of
Why does it get cut off at the special character? I saved the CFG files in UTF-8 and UTF-8 w/o BOM and it made no difference. Is there a way to do this? Something to do with Basechat?

Last edited by Ellie; 01-30-2014 at 14:22.
Ellie is offline
DJ Data
SourceMod Donor
Join Date: Dec 2012
Location: Switzerland
Old 01-30-2014 , 14:45   Re: Special characters in print to chat from console.
Reply With Quote #2

You may want to make a plugin and use the UTF Format Class.
PHP Code:
ServerCommand("sm_say Welcome all fans of %u Hello Kitty %u"utf_string_hereutf_string_here); 
Im not sure though ;)
__________________
SourcePawn Coding Level: Novice

Last edited by DJ Data; 01-30-2014 at 14:45.
DJ Data is offline
Ellie
Senior Member
Join Date: Apr 2013
Old 02-03-2014 , 04:16   Re: Special characters in print to chat from console.
Reply With Quote #3

So it can't be done without a plugin? it would very odd if that's the case. The text file shows the characters just fine. And even in HLSW if I type in that command it displays the characters to players in game just fine. So what's the deal?
Ellie is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-03-2014 , 11:28   Re: Special characters in print to chat from console.
Reply With Quote #4

What code are you using to read from the file?

Quote:
Originally Posted by DJ Data View Post
You may want to make a plugin and use the UTF Format Class.
PHP Code:
ServerCommand("sm_say Welcome all fans of %u Hello Kitty %u"utf_string_hereutf_string_here); 
Im not sure though ;)
"u" is "Unsigned integer number as decimal" in the documentation...
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 02-03-2014 at 11:29.
Powerlord is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 02-03-2014 , 14:26   Re: Special characters in print to chat from console.
Reply With Quote #5

there is formating rule of UTF8 as i recall from my reading.. maybe you missing this one..

p/s: its been long you didnt post something.. i miss you so much my Rosss...

EDIT: I think firgram point this out.. miss him too.. didnt troll him in a while.. >.<"
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.

Last edited by GsiX; 02-03-2014 at 14:28.
GsiX is offline
Ellie
Senior Member
Join Date: Apr 2013
Old 02-05-2014 , 00:06   Re: Special characters in print to chat from console.
Reply With Quote #6

Quote:
Originally Posted by Powerlord View Post
What code are you using to read from the file?


"u" is "Unsigned integer number as decimal" in the documentation...

I'm simply using CFG files which have those say commands in them. And we use the admin menu to execute the CFG files.
Ellie is offline
Pyro_
Senior Member
Join Date: Oct 2013
Old 02-05-2014 , 02:42   Re: Special characters in print to chat from console.
Reply With Quote #7

https://wiki.alliedmods.net/Format_C...eMod_Scripting)

It's %c
Pyro_ is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-05-2014 , 11:31   Re: Special characters in print to chat from console.
Reply With Quote #8

Re-compile SM basechat plugin, before this, convert plugin source files (*.sp) to UTF-8 without BOM format.
*edit
Use Notepad++ or else, not notepad.exe

Last edited by Bacardi; 02-05-2014 at 11:34.
Bacardi is offline
Ellie
Senior Member
Join Date: Apr 2013
Old 02-09-2014 , 23:52   Re: Special characters in print to chat from console.
Reply With Quote #9

Thank you. I'll try it now
Ellie is offline
Ellie
Senior Member
Join Date: Apr 2013
Old 02-18-2014 , 16:34   Re: Special characters in print to chat from console.
Reply With Quote #10

I did that. It still doesn't work. The plugin encoding was changed to UTF-8 w/o BOM (I even added a special character to make sure it saved in that format). The messages still get cut off right where the first special character is supposed to be
Ellie 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 08:07.


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