ID:2520161
 
Resolved
Icon states with accented characters didn't work correctly in output or grids.
BYOND Version:513.1495
Operating System:Windows 10 Pro 64-bit
Web Browser:Chrome 78.0.3904.87
Applies to:Dream Seeker
Status: Resolved (513.1497)

This issue has been resolved.
Descriptive Problem Summary:
Icon states with an 'é' character (and potentially other accents as well) do not appear when assigning them to interface elements such as labels or grids, despite appearing perfectly fine otherwise. This also appears to be the case for icons generated via the icon() proc (separate bug report for that one: http://www.byond.com/forum/)

Example Project for demonstration: https://drive.google.com/file/d/ 111e9DL54uA5DKB3boRwZnrXMjSpUcXyU/view?usp=sharing
(note: movement is not enabled here, likely due to me not setting up the proper macros for it).

Numbered Steps to Reproduce Problem:
1: Create an icon
2: Assign the icon an icon_state that has 'é' or another accent character in it
3: Assign the icon to an interface element via winset() (or, in the case of a grid, output())
4: Watch it not appear

Code Snippet (if applicable) to Reproduce Problem:
// See the example link:
// https://drive.google.com/file/d/111e9DL54uA5DKB3boRwZnrXMjSpUcXyU/view?usp=sharing


Expected Results:
The icon appears in the interface

Actual Results:
The icon does not appear in the interface.

Does the problem occur:
Every time? Or how often?
In other games?
In other user accounts?
On other computers?

When does the problem NOT occur?

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
This worked in all versions 512 and Prior.

Workarounds:

Because this case also uses icon() it's actually the exact same issue as id:2520163. Since you posted that later it's easier to simply close this issue than combine them.
Lummox JR resolved issue
In response to Lummox JR
Lummox JR wrote:
Because this case also uses icon() it's actually the exact same issue as id:2520163. Since you posted that later it's easier to simply close this issue than combine them.

This was more a case of me not explaining the issue properly than anything; the interface issue I was referring to here was using the \icon macro to make the icon appear in a grid or output control.

I don't make a significant use out of grids though, so it's something I can live with.
Well it should be fixed in 1496 regardless, since the icon() issue was fixed. The code you sent was definitely also using icon() so the fact that it used the \icon macro wasn't actually germane to the problem.
In response to Lummox JR
Lummox JR wrote:
Well it should be fixed in 1496 regardless, since the icon() issue was fixed. The code you sent was definitely also using icon() so the fact that it used the \icon macro wasn't actually germane to the problem.

It's likely more of an example of my code organization being off, because the case I used the \icon macro was on an object that used icon and icon_state directly, as seen with the code I sent but with the icon() proc uses (which I used for the label and the overworld icon) removed for clarity.

obj
item
Poke_Ball
icon = 'Pokéballs.dmi'
icon_state = "Poké Ball"

client
New()
var obj/item/Poke_Ball/PKBall = new
src << output("\icon[PKBall]", "grid1:1,1")
..()


In the code example I sent, the icons now properly appear on the overworld mob and for the label, but for the grid cell, the icon still does not appear (using the code above from the code sample I sent)
In response to Pokemonred200
The \icon macro is for icons, not for atoms. You're passing the wrong thing to the macro.

If you still have an example of 512 and 513 behaving differently I would recommend sharing a new test project for that, but IIRC the way you used the \icon macro here won't work in 512 either.
In response to Lummox JR
Lummox JR wrote:
The \icon macro is for icons, not for atoms. You're passing the wrong thing to the macro.

If you still have an example of 512 and 513 behaving differently I would recommend sharing a new test project for that, but IIRC the way you used the \icon macro here won't work in 512 either.

The reference explains that the \icon macro, when used on an object (as in this case), would display the icon that the object uses:

The \icon macro is used to treat the following embedded expression (in []'s) as an icon rather than as text. An object, for example, would be replaced by its icon rather than by its name.

//Example:
usr << "You look like this: \icon[usr]!"


The \icon macro expands internally to the IMG tag. The above example, could be rewritten like this:
usr << "You look like this: \
<IMG CLASS=icon SRC=\ref
[usr.icon] ICONSTATE='[usr.icon_state]'>!"

It did behave as explained here in 512 and prior, though I will put together a second test project later today that uses solely the \icon text macro and the expanded form using an img tag, if it makes the issue easier to isolate.
Given the expanded form listed in the reference uses the '\ref' text macro to reference usr.icon though, I feel like there's a chance it could be relating to that, though the macro works on icons linked in text via winset, so I'm not sure if could be the cause.
Example Project, using a different icon (the Heavy Ball) to compare to: https://drive.google.com/file/d/ 1fonzB3jLP6UkvOp1fPSBAvP2gxEJKHIP/view?usp=sharing

In this example, the Poké Ball icon does not appear in the grid, while the Heavy Ball icon does, in spite of both using the \icon macro and the tag that it expands to. With the way it's set up, both icons should logically appear in the grid twice, but at present this is not the case.
Okay, thanks. I'll take a look at that project and see what I find.
Lummox JR resolved issue with message:
Icon states with accented characters didn't work correctly in output or grids.