DatabaseTable resource bundles - character sets

Hi,
I'm considering moving our current properties-file based resource bundles to databaseTable resource bundles. In future, we intend to upgrade to multi-language. However our database character set is currently US7ASCII. Am I right in thinking that we will not be able to use non-US characters unless we upgrade our NLS_CHARACTERSET first? If so, the impact might be less if we stay with properties files.
thanks,
Mike

Hi Mike,
An oracle database also has a NCHAR_CHARACTERSET which probably is utf16. (look it up: select * from nls_database_parameters)
If so you could alter the jheadstart table that contains the resources (JHS_TRANSLATIONS I believe is was).
Alter the text column from varchar to nvarchar.
Probably works...didn't test it though...
Groeten,
HJH

Similar Messages

  • DatabaseTable resource bundles - performance

    Hello,
    Are there any known performance issues with databaseTable resource bundles vs "normal" properties-based bundles? Or to put it another way, is there any benefit to be gained from using properties-based bundles instead of databaseTable?
    We have had performance issues in the past because of the way we were using properties files, so we'd like to take the right approach from the start this time.
    I understand that the only difference is when they are loaded into the cache. I suppose the performance hit would be for the first ADF page to reference a property?
    thanks,
    Michael

    Mchael,
    That's correct. Only difference is the way the entries are loaded the first time. AFter that, caching is the same as for property files.
    Steven Davelaar,
    JHeadstart team.

  • Trouble resolving resource bundle message with validator.

    Hi,
    I'm using an af:validateDateTimeRange component (with only a minimum date), and want to change the validation message that is displayed to a custom message.
    I have this message in the resource bundle, but the component does not seems to pick it up, and just uses the default message instead. The only ways I've got it to display the correct message are :
    - Hardcoding the message into the minimumMessageDetail attribute (currently done this way).
    - binding the minimumMessageDetail attribute to a managed bean's property.
    Is there any reason why it's not picking up the message from the resource bundle? (Yes, the resource bundle is set up correctly - it's used everywhere throughout the application.)

    Ok my diagnosis of this is that references to keys in a property bundles from the attributes
    maximumMessageDetail
    minimumMessageDetail
    notInRangeMessageDetail
    Do not work. Hardcoded values work in notInRangeMessageDetail, but not the other two - does that agree with what you see?

  • Character encoding in resource bundle files

    I am developing a multilingual site, using resource bundle files. The problem I'm having is that, while the jsp file is save in UTF-8, and the contentType="text/html; charset=UTF-8", the foreign characters in the bundle files don't display properly unless I save them as "windows-1252". If I copy the text and paste it into the jsp file, it displays correctly.
    How can I make the text from the bundle files display the same as the text in the jsp document itself when both files are saved as UTF-8? I'm surprised it doesn't do this by default.

    Because resource bundles (the PropertyResoureceBundle class in particular) doesn't know anything about JSP or HTML page encodings. All that class knows is that it needs to load a properties file from the local (server-side) file system. (BTW, if you are using Struts MessageResources, it works the same way). Anyway, it doesn't read the file every time you call for a resource property String, it reads it 1 time, and 1 time only when you call new ResourceBundle().
    The API docs (in java.util.Properties) specified that properties files are read using the ISO8895-1 encoding, actually, not the Windows-1252 or whatever the OS defines. So if you store text that's using a different encoding then ISO8895-1, it's going to read the chars incorrectly.
    native2ascii converts things to ASCII using Unicode escapes, as I said. (Although, maybe it saves as ISO8895-1, I forget..., or maybe you should specify the output encoding.... you'd have to read the docs on that tool, cuz there's no command-line help.) This is sort-of an exception to the ISO8895-1 thing, in a sense, as all ASCII chars are the same as the first 127 chars of ISO8895-1, so it doesn't matter really.
    So in short, it doesn't assume it's in the default Windows encoding, it assumes it's in ISO8895-1. But since the API docs specifically say so, you should abide by those rules.
    As for "getting around the problem", yes, it does, actually. See, whatever it reads in that Unicode escaped ASCII text is converted properly to Strings in Java, which are 16-bit Unicode characters, which cover nearly every character set around (English, Chinese, Japanese, Arabic, Cyrillic, etc). When it's in that form, the chars are the Unicode chars and that's it. That's all they need to be. Encodings are only important when writing (and reading back) to files or other byte streams. You have to read in with the same encoding it was written under, otherwise the conversion is not going to be correct (with a few exceptions, but not many).
    So that creates a Unicode String in Java, and when you write that to a JSP page or servlet, the output writer used knows from the content type you specified in the page declaration (UTF-8 is typically recommended because it's an efficent way to deal with Unicode chars, particularly in HTML, where most of the HTML tag content is still ASCII text), so it encodes the strings in that encoding.
    Get it?

  • How can we set page title from resource bundle

    Hi friends ,
    how can we set page title from resource bundle,
    <%--
        Document   : MARC008Music
        Created on : Aug 4, 2008, 6:27:06 PM
        Author     : root
    --%>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
    <title>All Transaction Log Details </title>
          </head>
        <body>
            <f:view>
                <f:loadBundle basename="#{utility.resourceBundle}" var="rb"/>
                <f:loadBundle basename="#{utility.messageBundle}" var="mb"/>
                <h:form>
                </h:form>
            </f:view>
        </body>
    </html>i want set title( All Transaction Log Details ) from resource bundle.

    My problem is solved , Thanking you Sir.
    Thanks & Regards,
    Edukondalu Avula

  • Using "{" character in resource bundle.

    Hello,
    I was to use a "{", "}" characters in resource bundle. The problem is that, when I get the resource value, I use the method: MessageUtils.substituteParams in order to replace parameters like {0}, {1}, ...
    Is there a way of escaping the "{", "}" characters with subtitureParams method ? I tried "\{" and it still didn't work.

    Please see the java-api docs for your answer:
    http://java.sun.com/j2se/1.5.0/docs/api/java/text/MessageFormat.html
    Using "\u2019" only works because it is an alternative quote character, but it is not the same as the standard ascii single quote (')
    If you want to include a ' in your format string, then put two next to each other like '' (like Pascal if anyone remembers that ...)
    If you want to quote anything else, then use single quotes to surround the quoted text eg. "The message is '{not a param string}'"

  • How to set title of jsp page from resource bundle

    hi ,
    How to set title of jsp page from resource bundle....

    Depends on how you configured and declared the resourcebundle in your JSP. The usual way is just<title>${resourceBundle.messageKey}</title>

  • Switching Character Sets in JDeveloper

    Hi, we have developed a number of Portlets on JDev 10.1.2 but used the default encoding of cp1252. When looking back on my course notes I saw that the course instructor had recommended that we set the default project encoding to UTF-8. What are the implications of using the default encoding? We have coded our portlets to use resource bundles in order that we can make them multi-lingual at some point in the future. Is UTF-8 essential for this and if so, should we take the hit now to re-encode ( on trying it, I got errors about malformed input values, mostly hyphens and apostorphes) or will it be a painless process if we do it later on?
    Thanks for any feedback.

    Hello,
    Specifying the character set for a WebLogic webservice (see:
    http://edocs.bea.com/wls/docs81/webserv/i18n.html#1069629) is one of the
    many enhancements made since the 6.1 release. If possible, the best
    solution for your webservice development would be to upgrade.
    Bruce
    "özkan Demir" wrote:
    >
    Hi all;
    I am developing RPC style webservices on weblogic server 6.1 with service pack
    2.
    I have a problem about character sets. I have to turkish language so that the
    character sets must be ISO-8859-9. But the soap messages are default UTF-8 so
    that turkish characters becomes undetermined.
    Is there a way that I can send soap messages in ISO-8859-9 character set or what
    do I have to solve the problem of turkish characters between the client and the
    server applications with webservices...Please Help!
    Thanks

  • Issue with resource bundle.

    Hi ,
    I have been facing a issue with getting properties from resource bundle.
    final ResourceBundle resourceBundle = ResourceBundle.getBundle("config/global");
    I had placed my global.properties file under "WEB-INF/classes/config" folder.It was working fine.I had resinstalled my sun one application server,.Now the server is throwing following exception -
    java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key record.length
    But the same war file is working fine when I deployed it in sun one app servers running other machines.
    when i changed the code to -
    final ResourceBundle resourceBundle = ResourceBundle.getBundle("config//global");
    it started working in machine as well.
    How can I resolve this?
    Thanks,.
    Vivek

    And also you can try like this,
    My locale file in backing bean is like this
    Locale bean
    public class LocaleBean {
    public String language = "en";
    * @return
    public void changeLocale(String language) {
    System.out.println("changeLocale " + language);
    this.language = language;
    this.setLanguage(language);
    Locale newLocale = new Locale(this.language);
    FacesContext context = FacesContext.getCurrentInstance();
    context.getViewRoot().setLocale(newLocale);
    JSFUtils.storeOnSession("LOCALE", language);
    System.out.println("end of change locale");
    public void setLanguage(String language) {
    this.language = language;
    public String getLanguage() {
    return language;
    public void changeLocaleAction(ActionEvent actionEvent) {
    changeLocale(this.language);
    // Add event code here...
    Faces-config.xml
    <?xml version="1.0" encoding="windows-1252"?>
    <faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee">
    <application>
    <default-render-kit-id>oracle.adf.rich</default-render-kit-id>
    <resource-bundle>
    <base-name>Resorces.xx</base-name>
    <var>message</var>
    </resource-bundle>
    <locale-config>
    <default-locale>en</default-locale>
    <supported-locale>ar</supported-locale>
    <supported-locale>en</supported-locale>
    </locale-config>
    </application>
    <managed-bean>
    <managed-bean-name>localeBean</managed-bean-name>
    <managed-bean-class>LocaleBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    </faces-config>
    and my resource bundle as this :
    xx_ar_AR.properties
    xx.properties
    And Project properties>compiler property >character encoding > UTF-8
    select Tools-->Preferences-->Environment
    and then set the encoding to UTF-8.
    no need to change your trinidad-config.xml
    Regards
    PY

  • How to compare and edit Resource bundle file using java programe

    Hi All
    I have two resource bundle with key, value and some comments. I need to write a java code to compare both of the values of the keys and if the values are different then i want to replace the second value with the first value.
    Its a programe which will udpate the second file with the first file values.
    I tried using Properties class but it didnt worked because when i am saving the file using store method it removes all the comments and the order of text also got disturbed.
    How I need to do this any help appriciated.
    Please elt me know if someone needs more info.
    Thanks in advance.

    Let's assume the ini file is a mapping type storage (key=value) so lets use Properties object. (works with java 1.4 & up)
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.util.Properties;
    public class Test {
         private static Properties props;
         public static void main(String[] args) throws IOException {
              File file = new File("test.ini");//This is out ini file
              props = new Properties();//Create the properties object
              read(file);//Read the ini file
              //Once we've populated the Properties object. set/add a property using the setProperty() method.
              props.setProperty("testing", "value");
              write(file);//Write to ini file
         public static void read(File file) throws IOException {
              FileInputStream fis = new FileInputStream(file);//Create a FileInputStream
              props.load(fis);//load the ini to the Properties file
              fis.close();//close
         public static void write(File file) throws IOException {
              FileOutputStream fos = new FileOutputStream(file);//Create a FileOutputStream
              props.store(fos, "");//write the Properties object values to our ini file
              fos.close();//close
    }

  • Resource bundle in shared library?

    Is it possible to create a resource bundle in a shared library so you can use the same resource bundle in different application?
    We are creating different ADF application and each of them should use the same resource bundle.
    I tried creating a new project that only contains the resource bundle and then add this to my jspx page:
    <c:set var="res"
             value="#{adfBundle['general.resources.generalBundle]}"/>When i do this, he can't find any entries. When i change the project properties and configure to use a single bundle for the entire project, this works.
    How can i share a bundle so each application does not need to create or copy/paste the bundle?
    Is it possible to deploy the bundle as a shared library? Even if their is nothing else, not even a single java class?
    Edited by: Yannick.O on Jul 28, 2010 10:45 AM

    Try to create a JAR with the resource file in it (under /META-INF) and add it as a library in your project.
    If it does not work, try to create a faces-config.xml file inside that directory that declares the resource file.
    I think it gets merged at runtime with the config of your application and resource bundle should be available.

  • Resource Bundle Problem

    I have a funny problem with Resource Bundles:
    In the property editor for a Hyperlink object I replaced the text property with the following: #{messages1.MyKey}
    I have defined an action on the hyperlink as follows:
    public String MyHyperlinkId_action ()
    String HyperlinkText = (String)MyHyperlinkId.getText();
    String HyperlinkID = MyHyperlinkId.getId();
    return null;
    getText() returns null since I use the Bundle to set the text. getId() returns the correct Id. If I hardcode the text in the property editor getText() returns that text correctly.
    Any idea, what the problem could be??
    Many thanks
    Tom

    Did you modify the hyperlink text property manually or through the property binding wizard. It could be a spelling mistake. Also make sure MyKey is defined in your resource bundle.

  • Java: Loading Resource Bundle File with UTF-8

    I have found out all my previous problems now, thank you all for your assitance with this...
    During the time we have worked so solve our problem with UTF-8 charset we have found new problem with this?
    I don't know if this is the right forum to put this up, if not please let us know where to go with this?
    I have prepared both Eclipse (JSP Files) and GlassFish to run all my files in charset UTF-8. Then i got my
    resource bundle files(property files) to use UTF-8 encoding. Everything looks fine in my text editor. Then
    when i upload these pages every character retrieved from my resource bundles look garbled. This is because
    Java loads property files using ISO 8859-1 character encoding.
    This is a problem from Sun i have read on the internet!
    Note: that in JDK 1.6, you can use PropertyResourceBundle constructor to take a Reader which uses UTF-8 encoding.
    please have a look at these links for more info:
    [http://www.kai-mai.com/node/128]
    [http://java.sun.com/javase/6/docs/api/java/util/PropertyResourceBundle.html]
    Note: PropertyResourceBundle can be constructed either from an InputStream or a Reader, which represents a property file.
    Constructing a PropertyResourceBundle instance from an InputStream requires that the input stream be encoded in ISO-8859-1.
    In that case, characters that cannot be represented in ISO-8859-1 encoding must be represented by Unicode Escapes,
    whereas the other constructor which takes a Reader does not have that limitation.
    What i have read and understand is that the real solution to the problem is: Get the fmt lib to use a Reader instead of an
    InputStream. Alternativly if it works get a ResourceBundle instead of creating one that is wrong all the time? I have to create
    my own ResourceBundle instead of using my own fmt lib wich i cannot trust in a way any more. Is this right or am i comletly wrong?
    My WebTexts files, en, sv and ry are my resource property bundles. To be able to read them i will use resource property bundle reader.
    Fmt lib gives me this but it seems that it inciates this in an InputStream (wich is looked to iso-8859-1) instead of a reader who can
    read UTF-8 without no problem. So can i get my fmt lib to change this or not, anybody have an idea about this???

    Torleif wrote:
    Ok, i know there are a few ways of doing this already. The problem is that i have no idea how to use these different problem solving issues. First we have the;
    1. native2ascii command line utility.
    2. use the XML properties format.
    3. other ways of converting from iso-8859-1 to utf-8.
    The last one i have tried already but i never get this to work. So after knowing of 2 standardized solutions you choose to implement your own non-standard soltion? That's usually not a good idea until you've verified that the standardized solution don't help.
    This is also not the best solution to the problem i have to say. This way i will have both properties files and source files to work with and that is to much i think. Either i will use the native2ascii command or use XML properties format like you say here. I need some more insight in how these two work only because i have no idea my self.Uhm .. read [the documentation|http://java.sun.com/javase/6/docs/api/java/util/Properties.html]? loadFromXML/storeToXML work pretty much exactly the same as load/store, except they handle XML. Try it, look at what it produces, learn.
    Could you please help and explain how to use either this native2ascii command line work or how this XML format properties would work for me. Please i need guidance here with this!!![native2ascii is documented as well|http://java.sun.com/javase/6/docs/technotes/tools/windows/native2ascii.html].
    If you have a specific question after reading those, feel free to ask here.
    You really have to work on your Google-fu, it seems to be too weak.

  • Default lookup of resource bundle is wrong ?

    Hi,
    i have defined resource bundle files for localizing purpose, which i define:
      localization.properties
      localization_da.properties (danish language)
      localization_sv.properties (swedish language)
    By default for all other languages than danish & swedish, it should use the localized texts from localization.properties
    However i have a weird scenario: i created a user with English language.
    On the development server, the user uses the localization.properties
    On the test server, the user (with english and all other languages than da/sv) uses the localization_da.properties INSTEAD!?!?
    I found the
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/42/938297a5061d69e10000000a1553f6/frameset.htm">Lookup of Recource Bundle</a>, which is quite useful but didn't help resolve this problem.
    As it states the locale is determined by the following priorities:
    1. Component locale (there's no setting in this case)
    2. Portal mandatory localte (no setting neither)
    3. User locale (i have set the bebud info and it shows correctly that user has EN language)
    4. Request locate (the request.getLocale also shows the EN language which is correct)
    5. Portal default locale (i checked prtDefault.properties file in both servers, it both set to EN/US as default setting)
    6. System default locale
       - Anyone know how to check JVM default language?
       I checked the windows language setting, both have EN as default so no different in this case neither.
    So how can one server uses the correct resource and another use the wrong resource still, any ideas??
    Are there any other settings i haven't checked yet? Any helps will be very appreciated.
    I think about my work around is to have only 3 resource files:
      localization_en.properties (english and other languages)
      localization_da.properties (danish language)
      localization_sv.properties (swedish language)
    but i don't sure if it's possible to have no default  localization.properties file?

    Hi,
    +"But what is the point of having Bundle class for let say EO"+
    The point is to allow applications to be translated into multiple languages so that - based on the user language setting - the application runs with native labels. This works well with the default properties or Java resource bundle in ADF BC. So what doesn't work is the solution you copied from the AMIS blog and you may want to reach out to them if this works for them and if not why. Oracle support is correct in that they cannot support 3rd party samples and demos
    Frank

  • Wrong default resource bundle is retrieved, anyone?

    Hi,
    i have defined resource bundle files for localizing purpose, which i define:
    localization.properties
    localization_da.properties (danish language)
    localization_sv.properties (swedish language)
    By default for all other languages than danish & swedish, it should use the localized texts from localization.properties
    However i have a weird scenario: i created a user with English language.
    On the development server, the user uses the localization.properties
    On the test server, the user (with english and all other languages than da/sv) uses the localization_da.properties INSTEAD!?!?
    I found the
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/42/938297a5061d69e10000000a1553f6/frameset.htm">Lookup of Recource Bundle</a>, which is quite useful but didn't help resolve this problem.
    As it states the locale is determined by the following priorities:
    1. Component locale (there's no setting in this case)
    2. Portal mandatory localte (no setting neither)
    3. User locale (i have set the bebud info and it shows correctly that user has EN language)
    4. Request locate (the request.getLocale also shows the EN language which is correct)
    5. Portal default locale (i checked prtDefault.properties file in both servers, it both set to EN/US as default setting)
    6. System default locale
    - Anyone know how to check JVM default language?
    I checked the windows language setting, both have EN as default so no different in this case neither.
    So how can one server uses the correct resource and another use the wrong resource still, any ideas??
    Are there any other settings i haven't checked yet? Any helps will be very appreciated.
    I think about my work around is to have only 3 resource files:
    localization_en.properties (english and other languages)
    localization_da.properties (danish language)
    localization_sv.properties (swedish language)
    but i don't sure if it's possible to have no default localization.properties file?

    Hi Matt,
    > but i don't sure if it's possible to have
    > no default localization.properties file?
    No, that leads to an exception if the language determined for a user is not reflected by some bundle file. You can still duplicate the localization_en.properties file to localization.properties.
    Anyhow, if - for whatever reason - the bundle localization_da.properties got selected for a certain user, it probably also will be selected if you provide additional property files...
    Hope it helps
    Detlev

Maybe you are looking for