Using Apostrophes inside Text String in XML

sman1975

Emperor
Joined
Aug 27, 2016
Messages
1,370
Location
Dallas, TX
Last question today, I promise! :crazyeye:

I'm using apostrophes inside text strings and have noticed they usually show up as a double quote instead.

I want: '

I'm getting: "

I've tied using these techniques:

<Set Text="Robert d'Artois"/>

<Set Text="'Robert d&apos;Artois"/>

<Set Text='Robert d&apos;Artois'/>​

but all of them show a double quote in the name instead of a single quote/apostrophe.

Does anyone else have a suggestion to get the single quote to work? Is this a ModBuddy issue?

Thanks!!!!!

sman
 
Use SQL instead.
 
Ugh. I probably should have, but don't know sql much.

The problem is, I've brute forced a rename of all the great persons/generals/admirals, etc. for my mod. It's set in medieval France, so I always hated seeing a general named "George Patton" roaming the map during the game - really takes away some of the "realism" I'm aiming for. There's probably 400+ names that I'd have to "move" from the xml format to sql. Not impossible, but man, I'd like to avoid that if possible...
 
You do know SQL and XML both insert themselves into the same database. If there's a name that you can't put in XML, do it in SQL.
 
hey - that's a great thought. just need to rework the 30-40 names using apostrophes in sql and leave the rest alone. will take a stab at that in the morning. thanks so much!
 
I prefer SQL also, but straight XML is possible. The trick for apostrophes and quotation marks is to use standard XML syntax rather than the abbreviated one. See the XML/SQL Cheat Sheet.

You can even mix and match the syntax in the same command, e.g.:
Code:
<Update>
  <Where Tag="YOUR_TAG"/>
  <Set>
    <Text>Text with 'apostrophes' and ”quotation marks"</Text>
  </Set>
</Update>
 
Thanks, Nutty. This is good info.
I decided to break down and learn a little sql... :blush: Only had about 40 tags to change. Used this:

Code:
UPDATE [Language_en_US] SET Text = 'Robert d''Artois' WHERE Tag = 'TXT_KEY_GREAT_PERSON_HAMILCAR_BARCA';

Seems to work just fine. Those marks between Robert d and ''Artois are actually two separate apostrophes, not a single double quote.

Thanks again!!
 
Top Bottom