write special character

write special character

3
NewbieNewbie
3

    Apr 04, 2007#1

    Hi

    I tried the new scritps for the first time.
    I made a script that should add the character em-dash (hex 97) to the document. This is the line:

    UltraEdit.activeDocument.write("—");

    21
    Basic UserBasic User
    21

      Apr 04, 2007#2

      I tried this script and it works.

      Code: Select all

      UltraEdit.insertMode();
      UltraEdit.hexOff;
      UltraEdit.ueReOn();
      
      UltraEdit.activeDocument.write("—");

      6,686585
      Grand MasterGrand Master
      6,686585

        Apr 04, 2007#3

        Have you installed latest hotfix v13.00+4?

        By the way: If you modify a HTML file you should use the HTML entity as recommended by the HTML standard. If you use HTMLTidy to check your HTML code you will get a warning when simply inserting a — as character and not correctly encoded. The entity is —.

        Read also carefully my post at Script files can't be UTF-8? and the pages referenced there.
        Best regards from an UC/UE/UES for Windows user from Austria

        3
        NewbieNewbie
        3

          Apr 04, 2007#4

          Hi

          Actually the one line code also works, but the activeDocument obviously has to be UTF-8. I had it in ASCII.

          Which is funny, because apparently you can not have the script file in unicode