Ionic alert buttons not showing foriegn accent words properly


#1

Hello friends,
Please help me solve this issue.
i am making an app in spanish but i am facing some problems regarding accent words alert buttons.
when i use the html code for the accent word, the frontend shows it as it is (the HTML code).

buttons: [
              {
                  text: 'cancelar',
                  role: 'cancel',
                  handler: () => {
                      console.log('Cancel clicked');
                  }
              },
              {
                  text: 'S&#00ED;',
                  handler: () => {
                      for (let i = 0; i < this.products.length; i++) {
                          if (this.products[i].id == productId) {
                              this.products.splice(i, 1);
                          }
                      }
                      this.listService.editList(this.listId, this.listName, this.products).then((res) => {
                          if (res.error == false) {
                              this.getList();
                              this.presentToast('Nombre de la lista editado con éxito');
                          };
                      }).catch((err) => {
                          console.error(err);
                          this.presentToast('algo salió mal');
                      });
                  }
              }
          ]

as you can see i have used &#00ED; in second button of alert box but it is showing the accent word like this

and when i use the accent word directly

buttons: [
              {
                  text: 'cancelar',
                  role: 'cancel',
                  handler: () => {
                      console.log('Cancel clicked');
                  }
              },
              {
                  text: 'Sí',
                  handler: () => {
                      for (let i = 0; i < this.products.length; i++) {
                          if (this.products[i].id == productId) {
                              this.products.splice(i, 1);
                          }
                      }
                      this.listService.editList(this.listId, this.listName, this.products).then((res) => {
                          if (res.error == false) {
                              this.getList();
                              this.presentToast('Nombre de la lista editado con éxito');
                          };
                      }).catch((err) => {
                          console.error(err);
                          this.presentToast('algo salió mal');
                      });
                  }
              }
          ]

it is showing the accent word like this

please help me out with this problem


#2

HI,

Can’t test it in Ionic at the moment but can you try S\u00ed instead of S&#00ED; ?

Tested in jsfiddle http://jsfiddle.net/wobp0wgu/
I used the hex code, http://lwp.interglacial.com/appf_01.htm