Henry Mok wrote:
> I have a question about the file encoding. I'd like to have xmlmind save
> the output file in US-ASCII. So in the Save Options, I've selected
> US-ASCII. This works fine in the application. The problem that I have is
> in the applet. When I go through the applet, I use javascript to pull
> out the edited xml.
> 
>  
> 
> <script>
> 
> function onSubmitForm() {
> 
>               var xxe = document.XXE;
> 
>               var myTextField =
> document.getElementById('editChapter:xxeDoc');
> 
>               myTextField.value = xxe.getDocumentContents(null, null);
> 
> }
> 
> </script>
> 
>  
> 
> This doesn't seem to work the same way as the File->Save because the
> output file is always in UTF-8. Is there any way around this?
> 

Sure. You must force the user preference called "encoding" to
"US-ASCII". See
http://www.xmlmind.com/xmleditor/_distrib/doc/help/com.xmlmind.guiutil.PreferencesEditorDialog.html#saveOptions

This is done like this using the application:

---
xxe -putpref encoding US-ASCII ...
---

See
http://www.xmlmind.com/xmleditor/_distrib/doc/help/command_line_usage.html

and like this in the applet:

---
<applet ...>
  <param name="appClass" value="...">
  ...
  <param name="argument0" value="-putpref">
  <param name="argument1" value="encoding">
  <param name="argument2" value="US-ASCII">
   ...
</applet>
---

See
http://www.xmlmind.com/xmleditor/_distrib/doc/configure/integrating_the_applet.html#applet_parameters


Reply via email to