ColdFusion won't display unicode (utf-8) characters

I have a very basic page with some unicode characters in it. ColdFusion won't properly display them. If I resave the page as .html (so the coldfusion server doesn't process it), the characters display fine.
Below is my page. Notice that the charset is set to utf-8.
I'm using Dreamweaver CS5.5. Running IIS 7 and CF 9.
The text "why isn’t this working" has a smart apostrophe that DOES NOT DISPLAY PROPERLY when run through CF. I've searched around and all I see is that CF has unicode "turned on by default" but no where can I find where to make sure it is set.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<body>
why isn’t this working?
</body>
</html>

it seems that having cfprocessingdirective in every template is a documented best-practice in the CFWACK (Vol 2).  I learned something new today. 
God, really?  Who came up with that?
One needs to put it in any file that has characters with "ASCII" codes higher than 127, so as to forewarn the compiler to expect them.  I also dunno why one can't just tell the compiler "treat all files this way".  It's daft not to.
Anyway, most CFM files - which ought to contain just code - shouldn't have a problem because code won't generally have anything outside the 0-127 range; just the odd hard-coded value.  So to recommend to put it at the top of every file is just stupid.  Put it in the files that need it. That's it.
As to why it needs to go in the file itself rather than somewhere "upstream" in the request - like OnRequestStart() or something is that this tag - unlike most - is a compile time directive (as opposed to runtime).  And at compile time, CF is not running the code, it's just compiling it, so it doesn't know anything about the sequence in which files will be called (indeed it's not actually the CFM files themselves being called anyhow).
Adam

Similar Messages

  • Create HTML file that can display unicode (japanese) characters

    Hi,
    Product:           Java Web Application
    Operating system:     Windows NT/2000 server, Linux, FreeBSD
    Web Server:          IIS, Apache etc
    Application server:     Tomcat 3.2.4, JRun, WebLogic etc
    Database server:     MySQL 3.23.49, MS-SQL, Oracle etc
    Java Architecture:     JSP (presentation) + Java Bean (Business logic)
    Language:          English, Japanese, chinese, italian, arabic etc
    Through our java application we need to create HTML files that have to display unicode text. Our present works well with English and most of the european character set. But when we tried to create HTML files that will display unidoce text, say japanese, only ???? is getting displayed. Following is the code we have used. The out on the browser displays the japanese characters correctly. But the created file displays only ??? in place of japanese chars. Can anybody tell how can we do it?
    <%
    String s = request.getParameter( "txt1" );
    out.println("Orignial Text " + s);
    //for html output
    String f_str_content="";
    f_str_content = f_str_content +"<HTML><HEAD>";
    f_str_content = f_str_content +"<META content=\"text/html; charset=utf-8\" http-equiv=Content-Type></HEAD>";
    f_str_content = f_str_content +"<BODY> ";
    f_str_content = f_str_content +s;
    f_str_content = f_str_content +"</BODY></HTML>";
    f_str_content = new String(f_str_content.getBytes("8859_9"),"Shift_JIS");
    out.println("file = " + f_str_content);
              byte f_arr_c_buffer1[] = new byte[f_str_content.length()];
    f_str_content.getBytes(0,f_str_content.length(),f_arr_c_buffer1,0);
              f_arr_c_buffer1 = f_str_content.getBytes();
    FileOutputStream l_obj_fout; //file object
    //file object for html file
    File l_obj_f5 = new File("jap127.html");
    if(l_obj_f5.exists()) //for dir check
    l_obj_f5.delete();
    l_obj_f5.createNewFile();
    l_obj_fout = new FileOutputStream(l_obj_f5); //file output stream for writing
    for(int i = 0;i<f_arr_c_buffer1.length;i++ ) //for writing
    l_obj_fout.write(f_arr_c_buffer1);
    l_obj_fout.close();
    %>
    thanx.

    Try changing the charset attribute within the META tag from 'utf-8' to 'SHIFT_JIS' or 'utf-16'. One of those two ought to do the trick for you.
    Hope that helps,
    Martin Hughes

  • Displaying unicode or HTML escaped characters from HTTPService in Flex components.

    Here is a solution on the Flex Cookbook I developed for
    displaying data in Flex components when the data comes back from
    HTTPService as unicode of HTML escaped data:
    Displaying
    unicode or HTML escaped characters from HTTPService in Flex
    components.

    Hi again Greg,
    I have just been adapting your idea for encountering
    occasional escaped characters within a body of "normal" text, eg
    something like
    hell&ocirc; sun&scaron;ine
    Now, the handy String.fromCharCode(charCode) call works a
    dream if instead of the above I have
    hell&#244; sun&#353;ine
    Do you know if there is an equivalent call that takes the
    named entities rather than the numeric ones? Clearly I can just do
    some text substitution to get the mapping, but this means rather
    more by-hand work than I had hoped. However, this is definitely a
    step in a useful direction for me.
    Thanks,
    Richard
    PS hoping that the web page won't simply outguess me and
    replace all the above! Basically, the first line uses named
    entities and the second the equivalent numbers...

  • Problems displaying unicode encodeded characters in components

    I'm having problems getting Flash to display unicode that is
    imported from XML. In the example below the unicode characters in
    the name tag come through in Flash exactly as typed eg: \u00EA
    The xml file is written by PHP.
    <?xml version="1.0"?>
    <!-- Generated On: Sep-11-2007 12:24:19
    --><Colortool><Siding><item><type>c</type><id>11</id><name>Rev\u00EAtement
    Sp\u00E9cial</name>
    etc..
    However I've also tried re-saving the file manually in an
    editor encoded as UTF-8. Same result.
    Setting up a little test like:
    temp = "Rev\u00EAtement de premi\u00E8re qualit\u00E9";
    trace ("temp: " + temp);
    Traces: Revêtement de première qualité as
    expected.
    Any ideas why it works when the variable is set in Flash, but
    not when it's loaded from XML?
    Thanks,
    Anson

    By experimenting and some searching through the net I figured out that you need to set the right font. Kannada can be displayed using Tunga font on windows. But neither HTMLEditor nor TextArea has a setFont() method. Instead I tried with Text.
    text.setFont(Font.font("Tunga", 25.0));
    This worked partially. For example, if I try printing the character 'ಲಿ' its two component characters 'ಲ ಿ' are getting printed. They are not joining to form one single character 'ಲಿ'. Kannada like other Indic scripts is a complex layout script and I figured out from this post that complex layouts are not yet supported.
    Re: Urdu language support in Javafx UI Controls
    Unfortunately I cant use javafx for my purpose :-((

  • Quotation marks display as &quot in web pages, I'm using Unicode UTF-8 character encoding.

    On many web pages, where a quotation mark character should appear, instead the page displays the text &quot. I believe this happens with other punctuation characters as well such as apostrophes although the text displayed in these other cases is different, of course. I'm guessing this is a problem with character encoding. I'm currently set to Unicode (UTF-8) encoding. Have tried several others without success.

    Here's a link where the problem occurs. Note the second line of the main body of text.
    http://www.sierratradingpost.com/lp2/snowshoes.html
    BTW, I never use IE, but I checked this site in IE and it shows the same problem, so maybe it is the page encoding after all rather than what I thought.
    In any case, my thanks for your help and would appreciate any solution you can suggest.

  • Image with foreign characters in name won't display

    I have an image on my drive whose name has foreign characters ("c�pia de frente.jpg"). To display the image my JSP reads the image name from the database and generates the following html:
    <img src="../pictures/c�pia de frente.jpg">The page then displays a broken image icon for this image. Images in the same list which do not have foreign chars get displayed accurately. When I choose "show image.." in my browser I see that the image name has been rewritten into the following: c%C3%B3pia%20de%20frente.jpg. The rewriting that will display the image is instead c%F3pia%20de%20frente.jpg. I found the correct rewriting on another of my JSP where the image with the foreign chars actually gets displayed correctly although the code to generate the html is the same on both pages and looks something like this (simplified):
    <logic:iterate id="listelement" name="list" property="rows" scope="request" type="org.apache.commons.beanutils.DynaBean">
    <%         
    out.write("<img src=\"../pictures/"+listelement.get("name").toString()+"\">");
                             %>  <br>                     
                            </logic:iterate> Every image that doesn't have foreign chars in its name gets displayed accurately but images with foreign chars in their names won't display. What am I doing wrong?
    Thanks
    Niklas

    Thanks, but it doesn't seem necessary to replace foreign characters. It works without replacing in one place but not in another which is confusing. I think it is something with the enconding but can't see what the difference is between the working and non-working code. In both pages I have put <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">I'd greatly appreciate any more suggestions to solve this problem.

  • TextEdit doesn't display UTF-8 characters corrrectly

    I have a plain text file with some German umlauts, encoded in UTF-8. When I select this file in the Finder, the umlauts are displayed correctly in the Preview. However, if I double click on that file to have it loaded into the TextEdit program, the umlauts are displayed incorrectly.
    The screenshot at ftp://ftp.cadsoft.de/pub/etc/mac-osx-utf-8-bug.png shows the Finder's window in the background, and the TextEdit window in the foreground.
    When I explicitly load the file into the TextEdit program, with "Plain Text Encoding" set to "Unicode (UTF-8)" the text is displayed correctly. Only with "Automatic" it doesn't work.
    Am I doing something wrong here, or is this an actual bug in TextEdit?
    Franz
    Mac mini   Mac OS X (10.4.6)  

    Well, the "Notepad" editor on Windows XP does it
    correctly with both UTF-8 and ISO8859-1 umlauts.
    I think Notepad identifies UTF-8 correctly because Windows (unlike other OS's) puts a BOM at the start of UTF-8 files. Normally you only see this at the start of UTF-16 files, which many text editors can identify correctly.
    However, if the Mac user clicks on our German
    README text file and has "Plain text file encoding"
    set to "Automatic" (which apparently is the default),
    he sees broken umlauts.
    Yes I think Automatic means MacRoman. One possible solution is to use either rtf or html for the readme. I think the encoding for these will be recognized correctly. You could also try putting a BOM at the start of your UTF-8 plain text file.
    I was unter the impression that "UTF-8" was the
    plain text format on the Mac
    No, OS X stores data internally as UTF-16. Anything using xml will be UTF-8, and that's now the default encoding in Mail for lots non-Roman scripts, but otherwise the other encodings seem to have pretty equal status.

  • Select characters/symbols won't display on iPod 160GB Classic since restore

    I don't know if anyone has come across this yet or not. My new iPod 160GB Classic crashed after 1 week. Since restoring, I've noticed that certain characters/symbols won't display in artist/title names on my iPod that used to display just fine before the restore (symbols like + and ÿ). The restore function says that it restores it to the 'original factory settings,' but obviously not. I have tried restoring again, but that hasn't solved the problem. I've tried getting the track names from Gracenote (thinking maybe it was a font-specific thing), but that didn't help either. I know it seems petty, but I'm not sure how to solve it. The latest update has been applied to my iPod and I have the latest version of iTunes. Any ideas? I believe the crash was caused by a third party software which has since been removed. I have not experienced any problems since.

    Probably, the easiest way to resolve this is to copy the artwork from one song on an album and paste it into every song on that album.
    In your iTunes Library, choose an album that has artwork issues; choose one track that has the artwork and copy it. Then:
    the slightly longer method is to check each song individually, until you find the one with the missing artwork. Paste (the copy previously made) from one of the other tracks on the album.
    a slightly quicker method is to highlight all the songs on that album (make sure it is just that one album) and paste the artwork into the box.
    Sync the iPod with your iTunes Library.

  • UTF-8 characters not displaying in IE6

    Dear Sirs,
    I have an issue in displaying UTF-8 characters in Internet explorer 6.
    I set up my all jsp pages encoding as UTF-8.
    Any language characters(like chinese,tamil etc) perfectly dispaying in firebox browser.
    But in internet explorer, the characters are not displaying.it displays like ?! ..
    Could any body help me out?
    Thanks
    mulaimaran

    Thanks Viravan,
    But, I have added this line in my jsp before html tag.
    <%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
    After html tag,i added this meta tag.
    <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
    So, the UTF-8 encoding is capable to show different language characters in firebox browser.
    But In Internet Explorer 6 other language characters not displaying..
    > jsp sends out the UTF-8 BOM (hex: EF BB BF) before
    the HTML tag.I cant understand this line.I m new one to java.
    So ,please help me out.
    Thanks
    mullaimaran

  • Unicode, UTF-8 and java servlet woes

    Hi,
    I'm writing a content management system for a website about russian music.
    One problem I'm having is trying to get a java servlet to talk Unicode to the Content mangament client.
    The client makes a request for a band, the server then sends the XML to the client.
    The XML reading works fine and the client displays the unicode fine from an XML file read locally (so the XMLReader class works fine).
    The servlet unmarshals the request perfectly (its just a filename).
    I then find the correct class, and pass it through the XML writer. that returns the XML as string, that I simply put into the output stream.
    out.write(XMLWrite(selectedBand));I have set correct header property
    response.setContentType("text/xml; charset=UTF-8");And to read it I
             //Make our URL
             URL url = new URL(pageURL);
             HttpURLConnection conn = (HttpURLConnection)url.openConnection();
             conn.setRequestMethod("POST");
             conn.setDoOutput(true); // want to send
             conn.setRequestProperty( "Content-type", "application/x-www-form-urlencoded" );
             conn.setRequestProperty( "Content-length", Integer.toString(request.length()));
             conn.setRequestProperty("Content-Language", "en-US"); 
             //Add our paramaters
             OutputStream ost = conn.getOutputStream();
             PrintWriter pw = new PrintWriter(ost);
             pw.print("myRequest=" + URLEncoder.encode(request, "UTF-8")); // here we "send" our body!
             pw.flush();
             pw.close();
             //Get the input stream
             InputStream ois = conn.getInputStream();
                InputStreamReader read = new InputStreamReader(ois);
             //Read
             int i;
             String s="";
             Log.Debug("XMLServerConnection", "Responce follows:");
             while((i = read.read()) != -1 ){
              System.out.print((char)i);
              s += (char)i;
             return s;now when I print
    read.getEncoding()It claims:
    ISO8859_1Somethings wrong there, so if I force it to accept UTF-8:
    InputStreamReader read = new InputStreamReader(ois,"UTF-8");It now claims its
    UTF8However all of the data has lost its unicode, any unicode character is replaced with a question mark character! This happens even when I don't force the input stream to be UTF-8
    More so if I view the page in my browser, it does the same thing.
    I've had a look around and I can't see a solution to this. Have I set something up wrong?
    I've set, "-encoding utf8" as a compiler flag, but I don't think this would affect it.

    I don't know what your problem is but I do have a couple of comments -
    1) In conn.setRequestProperty( "Content-length", Integer.toString(request.length())); the length of your content is not request.length(). It is the length of th URL encoded data.
    2) Why do you need to send URL encoded data? Why not just send the bytes.
    3) If you send bytes then you can write straight to the OutputStream and you won't need to convert to characters to write to PrintWriter.
    4) Since you are reading from the connection you need to setDoInput() to true.
    5) You need to get the character encoding from the response so that you can specify the encoding in           InputStreamReader read = new InputStreamReader(ois, characterEncoding);
    6) Reading a single char at a time from an InputStream is very inefficient.

  • UTF-8 characters in database

    Hi there,
    I'm having problems with UTF-8 characters displaying incorrectly. The problem seems to be that the Content-Type HTTP headers have the character set as "Windows 1252" when it should be UTF-8. There is a demonstration of the problem here:
    http://teasel.homeunix.net/~rah/screenshots-unicode-db/apex-unicode-display.html
    I though I'd solved this previously, because I changed the nls_lang variable in wdbsvr.app to use single-quotes instead of double-quotes. After I did this, the server started sending Content-Type HTTP headers with UTF-8 in them and the characters in the example above displayed fine. For some reason, it seems to have reverted to sending "Windows 1252" and I don't know why.
    I noticed that the logs contain the following lines:
    [Wed Nov  1 09:50:45 2006] [alert] mod_plsql: Wrong language for NLS_LANG 'ENGLISH_UNITED KINGDOM.AL32UTF8' for apex DAD
    [Wed Nov  1 09:50:45 2006] [alert] mod_plsql: Wrong charset for NLS_LANG 'ENGLISH_UNITED KINGDOM.AL32UTF8' for apex DAD
    Any help getting it to send UTF-8 would be greatly appreciated.
    Thanks,
    Robert

    However I believe that it is correct to use double
    quotes rather than single quotes where the setting in
    the nls_lang contains space.Well, this is odd; using double quotes gives the same error, but with the double quotes instead of the single in the error message:
    [Thu Nov  2 09:43:42 2006] [alert] mod_plsql: Wrong language for NLS_LANG "ENGLISH_UNITED KINGDOM.AL32UTF8" for apex DAD
    [Thu Nov  2 09:43:42 2006] [alert] mod_plsql: Wrong charset for NLS_LANG "ENGLISH_UNITED KINGDOM.AL32UTF8" for apex DAD
    This implies that the parser is pulling the string out verbatim and including the quotes when it shouldn't. Lo and behold, removing any quotes:
    nls_lang = ENGLISH_UNITED KINGDOM.AL32UTF8
    causes the error to go away, and causes the HTTP headers to declare UTF-8; problem solved.
    I'm loathe to step ahead again and say that the docs need updating, but it certainly looks that way.
    Robert

  • Unicode line-drawing characters - possible Java bug?

    Hi all, I am trying to draw a box using line drawing characters in UTF-8. I make the UTF-8 box file in Microsoft Word where it looks aligned. However, when I run my Java program to display the box in a JTextArea, it is all out of alignment like below. Is this a bug in Java that prevents it from displaying aligned line-drawing characters? I am tearing my hair out over this so your help is much appreciated.
    Regards,
    Rianmal.
    &#9556;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9559;
    &#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;
    &#9553; &#9553;
    &#9553;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#9553;
    &#9553;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#9553;
    &#9553;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#9553;
    &#9553;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#9553;
    &#9553;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#9553;
    &#9553;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#9553;
    &#9553;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#9553;
    &#9553;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#9553;
    &#9562;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9565;

    sabre,
    Looks like monospaced isn't found on windows (vista)... So I used "Courier New" instead.
    Sabre20090412a.java is saved with encoding=UTF-8 (i.e. CP1252) instead of the default ASCII, which doesn't support the extended characters.
    package forums;
    import java.awt.Font;
    import javax.swing.JFrame;
    import javax.swing.JTextArea;
    public class Sabre20090412a
      private static final String text;
      static {
        String t;
        t =  "&#9556;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9559;\n"; // LINE 12
        t += "&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;&#9553;\n";
        t += "&#9553;                   &#9553;\n";
        t += "&#9553;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#9553;\n";
        t += "&#9553;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#9553;\n";
        t += "&#9553;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#9553;\n";
        t += "&#9553;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#9553;\n";
        t += "&#9553;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#9553;\n";
        t += "&#9553;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#9553;\n";
        t += "&#9553;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#9553;\n";
        t += "&#9553;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#8729;&#9553;\n";
        t += "&#9562;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9565;\n"; // LINE 23
        text = t;
      public static void createAndShowGUI() {
        final JFrame frame = new JFrame("Test");
        final JTextArea ta = new JTextArea();
        ta.setFont(new Font("Courier New", Font.PLAIN, 14)); // <<<<< Note font-name="Courier New"
        ta.setText(text);
        frame.setContentPane(ta);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      public static void main(String[] args) {
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            createAndShowGUI();
    build (NOTE the -encoding utf-8)*
    cd /d C:\Java\home\src\forums
    "C:\Program Files\Java\jdk1.6.0_12\bin\javac.exe" -encoding utf-8 -Xlint -d C:\Java\home\classes -cp c:\java\home\src;.;C:\Java\home\classes C:\Java\home\src\forums\Sabre20090412a.java
    run
    cd /d C:\Java\home\src\forums
    "C:\Program Files\Java\jdk1.6.0_12\bin\java.exe" -cp C:\Java\home\classes forums.Sabre20090412a
    References:
    http://www.google.com/search?q=warning%3A+unmappable+character+for+encoding+Cp1252&hl=en
    http://en.wikipedia.org/wiki/Windows-1252 #says 1252== IANIA UTF-8 except
    http://www.utf8-chartable.de/unicode-utf8-table.pl #page for 2500 onwards
    http://forums.sun.com/thread.jspa?threadID=5185338 #-encoding
    http://www.java2s.com/Code/Java/2D-Graphics-GUI/Listallavailablefontsproviedinthesystem.htm
    Roedy Green rocks!
    http://mindprod.com/jgloss/font.html#AVAILABLEJ
    http://mindprod.com/applet/fontshower.html
    Thanx for the fish!
    Cheers. Keith.

  • Display of ISO8859-1 characters broken in Terminal app?

    I've had this issue for years, but never got around to pursuing an answer until now.
    I cannot get the Mac Terminal application to display ISO8859-1 characters with
    diacritical markings, regardless of the locale and display settings.  It works fine
    in xterm.
    In Terminal, I get the following output (from an anagram generator I wrote):
      $ a9 -cux 1 orale | head -1
      ??rale!
    In xterm, I get what I would expect to get:
      $ a9 -cux 1 orale | head -1
      ¡Órale!
    Running the output through od produces the same output in both:
      $ a9 -cux 1 orale | head -1 | od -b
      0000000   302 241 303 223 162 141 154 145 012
    The locale is the same in both:
      $ locale
      LANG="en_US.ISO8859-1"
      LC_COLLATE="en_US.ISO8859-1"
      LC_CTYPE="en_US.ISO8859-1"
      LC_MESSAGES="en_US.ISO8859-1"
      LC_MONETARY="en_US.ISO8859-1"
      LC_NUMERIC="en_US.ISO8859-1"
      LC_TIME="en_US.ISO8859-1"
      LC_ALL=
    The default set of terminal encodings are enabled, including Western (ISO Latin 1).
    Numerous other combinations of locales with C, UTF-8 make no useful difference.
    FWIW, I haven't had any problem with this on Linux over the last 15 years, so it's
    been easy to ignore the problem on the Mac.  But I'd like to figure it out now.

    Hi,
    My default Terminal settings in Preferences > Settings > Advanced > Character Encoding is set to 'Unicode (UTF-8)'.
    Do you have that option?
    John M

  • More Cf + MySQL 5 + Unicode/UTF-8 Problems

    Here is the problem:
    I am using a MySQL database that store data in Unicode/UTF-8
    (the website/database are in Lao).
    Settings:
    CF 7.0.2
    MySQL 5.0.26
    MySQL Defaults: latin1_swedish_ci collation, latin1 encoding
    Database Defaults: utf8_general_ci collation, utf8 encoding
    These are same on my local computer and on the host
    (HostNexus)
    The only difference is that my CF uses
    mysql-connector-java-3.1.10 driver while the host uses MySQL 3.x
    driver (org.gjt.mm.mysql.Driver class).
    On my local computer everything works just fine, even without
    any extra CF DSN settings (i.e. connection string and/or JDBC URL
    do not need the useUnicode=true&characterEncoding=UTF-8 strings
    added to show Lao text properly).
    On the host, even with the
    useUnicode=true&characterEncoding=UTF-8 added (I have even
    tried adding
    &connectionCollation=utf8_unicode_ci&characterSetResults=utf8
    to the line as well), I only get ??????? instead of Lao text from
    the db.
    The cfm pages have <cfprocessingdirective> and
    <cfcontent> tags set to utf-8 and also have html <meta>
    set to utf-8. ALl static Lao text in cfm pages shows just fine.
    Is this the problem with the MySQL driver used by the host?
    Has anyone encountered this before? Is there some other setting I
    have to emply with the org.gjt.mm.mysql.Driver class on the host?
    Please help!

    Thanks for your reply/comments, Paul!
    I also think it must be the db driver used on the host... I
    just don't understand why the DSN connection string
    (useUnicode=true&characterEncoding=UTF-8 [btw, doesn't really
    matter utf8 or UTF-8 - works with both; I think the proper way
    actually is UTF-8, since that is the encosing's name used in
    Java...]) wouldn't work with it??? I have the hosting tech support
    totally puzzled over this.
    Don't know if you can help any more, but I have added answers
    to your questions in the quoted text below.
    quote:
    Sabaidee wrote:
    > Here is the problem:
    > I am using a MySQL database that store data in
    Unicode/UTF-8 (the
    > website/database are in Lao).
    well that's certainly different.
    I mean, they are in Lao language, not that they are hosted in
    Laos.
    > Database Defaults: utf8_general_ci collation, utf8
    encoding
    how was the data entered? how was it uploaded to the host?
    could the data have
    been corrupted loading or uploading to the host?
    The data was entered locally, then dumped into a .sql file using
    utf8 charset and then the dump imported into the db on the host,
    once again with utf8 charset. I know the data in the database is
    correct: when I browse the db tables with phpMyAdmin, all Lao text
    in the db is displayed in proper Lao...
    > The only difference is that my CF uses
    mysql-connector-java-3.1.10 driver
    > while the host uses MySQL 3.x driver
    (org.gjt.mm.mysql.Driver class).
    and does that driver support mysql 5 and/or unicode?
    I am sure it does support MySQL5, as I have other MySQL5
    databases hosted there and they work fine. I am not sure if it
    supports Unicode, though.... I am actually more and more sure it
    does not... The strange this is, I am not able to find the java
    class that driver is stored in to try and test using it on my local
    server... I have asked the host to email me the .jar file they are
    using, but have not heard back from them yet...
    > On my local computer everything works just fine, even
    without any extra CF DSN
    > settings (i.e. connection string and/or JDBC URL do not
    need the
    > useUnicode=true&characterEncoding=UTF-8 strings
    added to show Lao text
    > properly).
    and what happens if you do use those? what locale for the
    local server?
    If I use just that line, nothing changes (apart from the 2 mysql
    variables which then default to uft8 instead of latin1) -
    everything works just fine locally.
    The only difference I have noticed between MySQL setup on my
    local comp and on the host is that on my comp the
    character_set_results var is not set (shows [empty string]), but on
    the host it is set to latin1. When I set it to latin1 on my local
    comp using &characterSetResults=ISO8859_1 in the JDBC URL
    string, I get exactly same problem as on the host: all ???????
    instead of Lao text from db. If it is not set, or set to utf8,
    everything works just fine.
    For some reason, we are unable to make it work on the host:
    whatever you add to the JDBC URL string or enter in the Connection
    String box in CF Admin is simply ignored...
    Do you know if this is a particular problem of the driver
    used on the host?
    > The cfm pages have <cfprocessingdirective> and
    <cfcontent> tags set to utf-8
    > and also have html <meta> set to utf-8. ALl static
    Lao text in cfm pages
    > shows just fine.
    db driver then.
    I think so too...

  • Read/Write file in Unicode (UTF-16)

    Hi, I have some issue to write a file in Unicode (UTF-16)
    I have to read a file with LabView, change some parameters and write the new data into the same file. The file uses Unicode UTF-16.
    I downloaded some library here: https://decibel.ni.com/content/docs/DOC-10153
    I can read the file, convert the data to UNI/ASCII/UNI, and then write the file. But when I open the new file with an editor like Notepad++ there are some unexpected characters at the end of the line.
    Even reading the file and writing exactly the same data doesn'not work.
    I attached an example.
    Thanks for you kind support.
    Solved!
    Go to Solution.
    Attachments:
    TEST.zip ‏7 KB

    Right-click on your Read and Write Text File functions.  There is an option to "Convert End Of Line".  Turn that off on both functions.
    As a side not, you don't need the Close File functions.  The Read and Write Text File functions will close the file if the file reference output is not wired.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for

  • Resized RAW Pictures

    I have LR 1.4 with XP as OS.Camera is Nikon 40DX with AF-S Nikkor 18-200 mm lens. Optimize image setting "Normal". This is the first time I have taken pictures in RAW format. All pictures I have taken in vertical turned into Thumbnail size after I do

  • How do I get air on my mac?

    I'm trying to d/l a calendar from Jaquie Lawson.  I need Adobe Air to run it.  I'm running OSX 10.4.11.  The Lawson site sent me to http://airdownload.adobe.com/air/mac/download/3.0/AdobeAIR.dmg  I d/l that, then tried to install it and got the messa

  • Pointing stick not working (EliteBook 8440p)

    Hi. I just bought a used HP EliteBook 8440p.  The laptop seems fine apart from one issue; the pointing stick is not working.  The buttons for the pointing stick does work, so does the touchpad and its buttons. If I open the device manager, I see an u

  • Java script will not work after creating new page

    I am using dreamweaver cs3 and have a java script to rotate a banner in a template.  This script has worked fine in the past when I created pages in Dreamwever.  Now the  script works fine only when I test it in a template but when I try to upload to

  • I'm sure you get this alot...but when will it happen...?

    My question is when will Palm introduce or implement the same call block technology mode used in these phones Palm OS 5, Palm Centro, Treo 650, Treo 680, Treo 700p and Treo 755p for the new family of plam prodcuts...Palm, Plam Pre, Plam Pixi and Palm