You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



PUBLIC char* XP_GetStringForHTML ( int id, int16 winCharSetID, char* english )

Get a cross platform HTML string resource by ID

Documentation

Get a cross platform HTML string resource by ID. This function makes localization easier for cross platform strings used for generating HTML. The cross platfrom string resources are defined in allxpstr.h. You should use XP_GetStringForHTML when:
  1. Human readable string not defined in front-end
  2. The code generates HTML page and will go into HTML window
  3. Only use this when the message will be generated into HTML.
  4. Only use this if you can access to the winCharSetID.
  5. This is needed because half of the text is generated from resource (in resource charset) and half of the text is coming from the net (in winCharSetID charset). When we meet this kind of mixing charset condition. We use this function instead of XP_GetString().
The code checks the current CharSetID in the resource and the CharSetID of the data from the net. If they are equal, it returns the string defined in the resource, otherwise, it will return the English version. So a French client can display French if the data from the net is in the CharSetID of French and it will use half English and half Japanese if the French client receives Japanese data from the net. The caller should make a copy of the returned string if it needs to use it for a while. The same memory buffer will be used to store another string the next time this function get called. The caller does not need to free the memory of the returned string.
Returns:
Localized (translated) string if the winCharSetID matches the CharSetID of the resource. Otherwise it returns the English message or the English string
Parameters:
id - Specifies the string resource ID
winCharSetID - Specifies the winCharSetID of the HTML
english - Specifies the English string
See Also:
XP_GetStringForHTML
INTL_ResourceCharSet

alphabetic index hierarchy of classes


Copyright © 1998 Netscape Communications Corporation

generated by doc++