UNICODE in Java (Round 2)

From: Nicholas Pappas (noreply_at_rightstep.org)
Date: 05/30/04


Date: Sun, 30 May 2004 13:35:58 GMT


        Hello all.

        First, a many thanks to all who helped out with my first issue with
getting UNICODE moving as it should in Java. I am now able to open the
file and store the strings as they appeared in Windows (using Cp1252)!
So, I'm a step closer!
        But, I've run into another problem.

        Once I have the string stored in my application, I try to load the
image it points to. If there are any UNICODE characters in the string,
then the image is not loaded correctly.

        Here is my "store" line:
textures[i] = new String(bmpPath, 0, len, "Cp1252");

        Then I attempt to open the image file:
RenderedImage img = (RenderedImage)JAI.create("fileload", filename);
RenderedImageAdapter ria = new RenderedImageAdapter(img);
BufferedImage buffer = ria.getAsBufferedImage();

        'filename' is passed to the function with the contents of the
textures[] array. I am currently using Blackdown 1.4.1 for the above
code. I do have 1 straight ASCII image in my texture array, and it
loads fine -- it is just the images w/ UNICODE (Korean) that cause problems.

        What can I do in the load sections to get these images to load
correctly? Thank you for any help!!



Relevant Pages

  • Re: How to check variables for uniqueness ?
    ... characters is the sequence SS. ... is simply capitalizing strings. ... The fact that case mapping in English /is/ simple is neither here not ... That is a fair criticism of the Unicode position. ...
    (comp.lang.java.programmer)
  • Re: Dangerous behavior of CString
    ... If I'm reading a data file or serial port or something, if the raw data are multibyte but the compilation is Unicode or vice-versa, then sometimes the converting constructors in CString are convenient. ... I did not actually write code like this; in fact I was pretty careful always to use the _T macro with any literal strings. ... But it does the conversion using the current 8-bit code page, which is not what I want. ...
    (microsoft.public.vc.mfc)
  • Re: Help please
    ... i would like to provide "CSimString" class code because the settings ... I agree with Tom that first step is project clean and rebuild all. ... with a Unicode string, ... Consider that VS2005 strings are Unicode by default, ...
    (microsoft.public.vc.mfc)
  • Re: passing a string to a dll
    ... bool DLLRect::PullWhisker ... The interface for the DLL exported function could be like so: ... based on _UNICODE flag, e.g. ... I think that in these days those ANSI strings are something from the ...
    (microsoft.public.vc.mfc)
  • Re: Want Input boxes to accept unicode strings on Standard Window
    ... strings with _T ... pattern) but these blow up immediately. ... as a "massive effort" or, in one case, "we need a complete rewrite in Unicode and can't ... the process a couple of times the conversion thing is pretty academic. ...
    (microsoft.public.vc.mfc)