10

I want to know if one a particular dialog i want to insert a copyright symbol , how would i do that i insert the symbol in th text options in the xml file howevr it results in an error while compiling the .wxs file.

Thanks

2 Answers 2

29

You have to make sure you save the WiX XML in UTF-8 encoding. The easiest way is to open the XML in Notepad, click File and then click Save as. Select UTF-8 in the Encoding list. And overwrite your current XML file.

Another way is use character codes: © for copyright and ® for registred symbols.


The thing is the regular English letters, or ASCII, are valid UTF-8 characters as they fit into 7-bits. The copyright and registred symbols are not valid characters because in UTF-8 they have to be encoded as two bytes rather than one.

7
  • I have tried using &#169 in the text section saving the file in UTF-8encoding and using the command line to convert it into the .wixobj file however it does not convert and gives an error as : error CNDL0104 : Not a valid source file; detail: Invalid syntax for a decimal numeric entity reference. Line 35, position 138. Please let me know if there is anyway to insert the copyright symbol in Notepad++ .
    – eddie
    Commented Jun 18, 2012 at 6:30
  • @eddie Please show your line 35. The semicolon is required for character entities as in ©. If you save your file in UTF-8, you can simply insert the © symbol or ®; I'd recommend this. If you want to stick with plain ASCII, then use character entities: © and ®. Commented Jun 18, 2012 at 10:00
  • i saved my file in UTF-8 and simple inserted the © however while i was doing an installation it does not show me the © symbols
    – eddie
    Commented Jun 18, 2012 at 11:08
  • @eddie Plus usually, © is not a valid character entity in XML unless of course it's defined in DTD. So for XML files, and WiX sources are XML files, it is safer to use decimal or hexadecimal character references as specified above. Commented Jun 18, 2012 at 11:45
  • 1
    I had to specify unicode as the codepage as well: Codepage="65001"
    – BryanJ
    Commented Jun 17, 2015 at 16:08
0

Here is a solution:

  1. Copy the notepad++ file text say "index.html" into plain old notepad

  2. Close the notepad++ file.

  3. Re type the text where you want the Copyright symbol by holding down Fn+alt typing 0169 on the keypad

  4. Save the plain notepad file as (all Files) index.html to the folder your index.html file is in when asked to overwrite click yes.

  5. Now open the file using notepad++ and this file when saved after any other edits will not produce the accented A beside the copyright symbol ©

I do not know why the saved version in notepad++ works after "cleansing" in plain notepad but I have not had any other problems using the method to date.

Not the answer you're looking for? Browse other questions tagged or ask your own question.