Please verify you are human

Nostale DMG counter + website
  Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Nostale
You last visited: Today at 04:13

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Nostale DMG counter + website

Discussion on Nostale DMG counter + website within the Nostale forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2014
Posts: 9
Received Thanks: 0
Nostale DMG counter + website

Hi, we are having Nostale DMG counter injected through DLL which counts some data on raids, total dmg, gold, etc...

When raid ends we are sending data to our website through API in JSON format.

Here is the problem:

Short:
Convert dynamic encoding std::string to utf-8 including special characters like ™.

Long:
JSON is in utf-8 format, so all data should be utf-8 too. All data is stored in variable C++ std::string and to my knowledge encoding of std::string depends on some things that are unknown to me(sometimes utf-8, utf-16, utf-32, windows..., and maybe more?). I tried convert them but with fail, special characters like ™ are being converted to wrong characters in utf-8. Anyone ideas?

Note: nicknames are displayed correctly in DMG counter (DLL).

Some screeshots if anyone is curious how it looks.


Bledis is offline  
Old 02/02/2021, 22:06   #2
 
WalrossGreat's Avatar
 
elite*gold: 0
Join Date: Mar 2015
Posts: 871
Received Thanks: 1,229
You need to convert those values from your local windows codepage like win1252 to utf-8 before displaying it on the website
WalrossGreat is offline  
Old 02/03/2021, 00:14   #3
 
elite*gold: 0
Join Date: Jul 2014
Posts: 9
Received Thanks: 0
Are you sure that std::string is always windows1252 when on Windows OS?

Is there any good library for this? I tried almost all code from stackoverflow etc... and nothing works in my case.
Bledis is offline  
Old 02/03/2021, 05:36   #4
 
elite*gold: 0
Join Date: Oct 2018
Posts: 257
Received Thanks: 207
Are you sure the encoding issue comes from your program and not from your site ? If you try to display an utf8 character on your console, even if the character is valid, you'll probably get some weird result.
What if you try to send to your server something like const char* test = u8"™" or const char* test = L"™" ?
Apourtartt is offline  
Old 02/03/2021, 11:09   #5
 
elite*gold: 0
Join Date: Jul 2014
Posts: 9
Received Thanks: 0
When I send std::string = u8"™" it works. So its issue with dynamic std::string.
Bledis is offline  
Old 02/03/2021, 12:34   #6
 
WalrossGreat's Avatar
 
elite*gold: 0
Join Date: Mar 2015
Posts: 871
Received Thanks: 1,229
Quote:
Originally Posted by Bledis View Post
Are you sure that std::string is always windows1252 when on Windows OS?
No it's not. std::string doesn't have any predefined encoding, it's just array of bytes. Run debugger and see what are the codes of those special characters, then compare it to some codepages like windows1252 and check if it is matching.
WalrossGreat is offline  
Old 02/09/2021, 10:28   #7
 
doddo978's Avatar
 
elite*gold: 0
Join Date: Sep 2011
Posts: 61
Received Thanks: 8
Quote:
Originally Posted by Bledis View Post
Hi, we are having Nostale DMG counter injected through DLL which counts some data on raids, total dmg, gold, etc...

When raid ends we are sending data to our website through API in JSON format.

Here is the problem:

Short:
Convert dynamic encoding std::string to utf-8 including special characters like ™.

Long:
JSON is in utf-8 format, so all data should be utf-8 too. All data is stored in variable C++ std::string and to my knowledge encoding of std::string depends on some things that are unknown to me(sometimes utf-8, utf-16, utf-32, windows..., and maybe more?). I tried convert them but with fail, special characters like ™ are being converted to wrong characters in utf-8. Anyone ideas?

Note: nicknames are displayed correctly in DMG counter (DLL).

Some screeshots if anyone is curious how it looks.



Hi man, can u share this project with us?
doddo978 is offline  
Old 02/12/2021, 12:47   #8
 
elite*gold: 0
Join Date: Jul 2014
Posts: 9
Received Thanks: 0
I might share if I have a good reason.
Bledis is offline  
Old 02/13/2021, 20:54   #9
 
doddo978's Avatar
 
elite*gold: 0
Join Date: Sep 2011
Posts: 61
Received Thanks: 8
Like helping the community?
I see your project very nice and it could help NosTale players to organize marathons talking about the web side
doddo978 is offline  
Reply


Similar Threads Similar Threads
[Selling] Website coding & editing! Cann create your website or edit your website cheep!
01/17/2016 - Coders Trading - 20 Replies
Hello i'm a web developer under education. Forum createde by me!: http://luckycs.com/ My skill is the following: asp.net = 5% mvc = 35% Umbraco (CMS) = 60% javascript/jquery = 40%
[Deribelle] WTT ring of power LVL 20 -- 1% chance on 110% of dmg, dmg +3
02/12/2010 - Archlord Trading - 1 Replies
I prefer to trade it for a Cast ring for lvl 20 with 5% cast, in deribelle.. or give me some offers :)
[Rogue] Depress about the -30% DMG Mutilate nerf? Un-Nerf Mutilate back to +50% DMG
04/27/2009 - WoW Exploits, Hacks, Tools & Macros - 8 Replies
As all rogues know with 3.09 Mutilate was nerfed from doing +50% damage on poisoned targets to +20% damage resulting in a 30% DMG nerf on your primary attack. Blizzard buffed up some other talents to compensate for the nerf. This however did nothing for the rogues that love to PVP and drop big mutilates on players. I did not find this bug on my own, but I can confirm the results. Here's a way to bring it back. If you spec in to Dirty Deeds it will give back the 30% damage you lost from the...



All times are GMT +1. The time now is 04:14.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.