Diablo® III

Special characters in Battletag

How do we retrieve data from a person that has special characters in his/hers battleTag
For example, this random person:
http://tw.battle.net/d3/zh/profile/弒神殺手-3389/
I tried: http://tw.battle.net/api/d3/profile/弒神殺手-3389/ but without any result.
While for example my own account (without special chars.) seems to work:
http://tw.battle.net/api/d3/profile/DANNEHR-2672/

Edit:It's also not a regional problem cause this EU player gives the same result:
http://eu.battle.net/d3/en/profile/Даррен-2806/
api >> http://eu.battle.net/api/d3/profile/Даррен-2806/
Edited by DANNEHR#2672 on 8/13/2012 8:11 AM PDT
Reply Quote
They're working on it, it's known.
http://us.battle.net/d3/en/forum/topic/6308661594
Reply Quote
I think that's another issue, this is one more about special characters in a battletag.
I'll edit the topic title.
Reply Quote
Same Problem. Using battletags with special characters like

http://eu.battle.net/api/d3/profile/Jérôme-2150/

gives "There was a problem processing the request." back.

Anyone an idea?
Reply Quote
Same here, can't fetch my stuff b/c of the special character.

If you allow special characters in battletags, the whole system should run fine with them, from my point of view.
Reply Quote
Web & Mobile Team
Posts: 726
Indeed, it looks like a bug in the parsing of urls in the API. We will look into it this week.
Reply Quote
Any updates on this?
Reply Quote
4 Human Mage
0
Posts: 27
Would like to know as well.
Reply Quote
Add index to the end of the URL and it will work. It's a temporary fix I'm using until they sort out the issues with career URLs.

IE:
http://eu.battle.net/api/d3/profile/Jérôme-2150/index
Reply Quote
In some cases even that does not work:

http://us.battle.net/api/d3/profile/Chl%C3%B2e-2629/

http://us.battle.net/api/d3/profile/Chl%C3%B2e-2629/index <-- NOTFOUND

But this works: http://eu.battle.net/d3/de/profile/Chl%C3%B2e-2629/
Reply Quote
You cannot access an EU profile from the US region.

Try: http://eu.battle.net/api/d3/profile/Chlòe-2629/index
Reply Quote
09/06/2012 01:39 PMPosted by Kalence
You cannot access an EU profile from the US region.


Thank you!

So we have to know ahead of time what channel or sub domain the profile should be searched on?

Also would it hurt to always include /index at the end of the url for safe measures?
Edited by XjSv#1677 on 9/6/2012 2:02 PM PDT
Reply Quote
Hi,

i have added this in the usage to compile the searchstring for the URL :

$Diablo3 = new Diablo3("".urlencode(utf8_encode($battleTag))."", 'eu');

Greetings

Jan
Reply Quote
Hi,

i have added this in the usage to compile the searchstring for the URL :

$Diablo3 = new Diablo3("".urlencode(utf8_encode($battleTag))."", 'eu');

Greetings

Jan

Thanks for the suggestion.

I have added urlencode() to the constructor as or yesterday afternoon Line #27:
https://github.com/XjSv/Diablo-3-API-PHP/blob/master/diablo3.api.class.php

But as you suggested i have also wrapped a utf8_encode() around the battle.net tag but this was causing issues and corrupting the battle.net tag, so i had to remove it.
Edited by XjSv#1677 on 9/7/2012 7:38 AM PDT
Reply Quote
Im glad when i could help...

If anyone want´s to use this :

$Diablo3 = new Diablo3("".urlencode(utf8_encode($battleTag))."", 'eu');

You have to deaktivate in line 36 of the diablo3.api.class.php this:

$battlenet_tag = urlencode($battlenet_tag);

Because when you use urlencode before utf8_encode the output is wrong. I´m sorry for my bad english ;)

Greetings

Jan
Reply Quote
Hey Erendil you don't need the utf8encode() function urlencode is enough.

Why do you feel that you need to use utf8encode?
Can you post the battle tag you are trying?

Also there has been substantial updates to the class for error handling and locale.
Reply Quote
When i use Chlòe-2629 with your

$battlenet_tag = urlencode($battlenet_tag);

there will be no accouts found... if i use Chlòe-2629 with the

$Diablo3 = new Diablo3("".urlencode(utf8_encode($battleTag))."", 'eu');

and without

$battlenet_tag = urlencode($battlenet_tag);

there will be found the account. On UTF-8 you must have a "%C3%B2" insteadt of the "ò" and the easyest way to get the %C3%B2 is urlencode(utf8_encode($str));
Reply Quote
When i use Chlòe-2629 with your

$battlenet_tag = urlencode($battlenet_tag);

there will be no accouts found... if i use Chlòe-2629 with the

$Diablo3 = new Diablo3("".urlencode(utf8_encode($battleTag))."", 'eu');

and without

$battlenet_tag = urlencode($battlenet_tag);

there will be found the account. On UTF-8 you must have a "%C3%B2" insteadt of the "ò" and the easyest way to get the %C3%B2 is urlencode(utf8_encode($str));


$Diablo3 = new Diablo3("Chlòe#2629", 'eu', 'en_US');


Array
(
[heroes] => Array
(
[0] => Array
(
[name] => Kaherjha
[id] => 15658579
[level] => 60
[hardcore] => 1
[paragonLevel] => 0
[gender] => 1
[dead] =>
[class] => barbarian
[last-updated] => 1347225590
)...


That works just fine. You don't find anything because your region needs to be set to "eu". Also make sure you get the latest copy, it has some bug fixes.
Edited by XjSv#1677 on 9/10/2012 7:09 AM PDT
Reply Quote
I have the last copy ... this is what i actually use :

$Diablo3 = new Diablo3("Chlòe#2629", 'eu', 'de_DE');

and there was in the array "No Data Returned"

I dont know how u do this that it works. I tested it on 6 different PC here ;) same error...

here ist the url : http://www.jan-seifarth.de/testumgebung/d3new/usage.php

here is the code :

<?php
// For timing
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;
// For timing

require_once('diablo3.api.class.php');

// Optional
//
require_once('functions.php');

// Settings
//
set_time_limit(0);
ini_set('memory_limit', '128M');

$Diablo3 = new Diablo3("Chlòe#2629", 'eu', 'de_DE'); // Battle.net Tag. (e.g. 'XjSv#1677' or 'XjSv-1677') (string), Server: 'us', 'eu', etc. (string) [Optional, Defaults to 'us'], Locale: 'en_US', 'es_MX', etc. (string)
$CAREER_DATA = $Diablo3->getCareer();

// Before handling the data check to make sure the return is an array
//
if(is_array($CAREER_DATA)) {
print_r($CAREER_DATA);
} else {
echo $CAREER_DATA; // Error message
}

// For timing
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
$total_time = secondsToTime($total_time);
echo '<br>Proccess finished in '.$total_time.' seconds.'."<br>";
// For timing
?>
Edited by Erendil#2204 on 9/10/2012 7:24 AM PDT
Reply Quote
Its funny because the above code that you posted works for me.

Test
http://www.armandotresova.com/lab/diablo-3-api-php/usage.php

Do you have any PHP errors? Can you check your error log?
Edited by XjSv#1677 on 9/10/2012 7:49 AM PDT
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Reason
Explain (256 characters max)
Submit Cancel

Reported!

[Close]