Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Help needed with accented characters

 [1/5] from: warren:howsoft at: 6-Feb-2008 16:37


Here's a little script: ------------------------------------------------ Rebol[] mylay: layout[ text-list "Florianópolis" ] view mylay ------------------------------------------------ Please note that the "o" in the middle of the word "Florianopolis" (between the "n" and the "p") has an accent over it. 1. In Ubuntu Linux (Dapper Drake), the script runs successfully, but the accented "o" is displayed as 2 chars which have nothing to do with an accented "o". 2. If I copy the script created in Ubuntu to another machine where I have Windows XP installed, it runs as it did in Ubuntu: i.e. the script runs, but the accented "o" is displayed as 2 chars which have nothing to do with an accented "o". 3. If I create a new identical script using Notepad in Windows XP, it doesn't run at all! I get the message "Syntax Error: Script is missing a REBOL header". Help! The current little project I am working on makes use of a list of client names, some of which contain accents. Is there a workaround? An example of noob ignorance? [In fact, my list of client names is loaded in a way which is more complicated than the simple example above suggests. Each client has a file in a folder, and the file name corresponds exactly to his/her name. The text-list is populated by grabbing the file names from the folder. But all that is immaterial in relation to the essential problem of course.] In Ubuntu, I am using View 1.3.2.4.2 In Windows XP I am using 1.3.2.3.1 Regards, Bob Warren

 [2/5] from: gregg:pointillistic at: 6-Feb-2008 11:58


Hi Bob, Sounds like an encoding issue. Check the Encoding box in Notepad. If it's set to Unicode, that will be your problem. Save the file as ANSI and you should be fine. The encoding in Ubuntu may be UTF-8. Do a READ on the file, in REBOL, and see what the resulting string looks like. -- Gregg

 [3/5] from: warren:howsoft at: 6-Feb-2008 18:09


Gregg Irwin wrote:
> Hi Bob, > Sounds like an encoding issue. Check the Encoding box in Notepad. If
<<quoted lines omitted: 3>>
> looks like. > -- Gregg
--------------------------------------------------------------------- Rebol[] mylay: layout[ text-list "Florianópolis" ] view mylay --------------------------------------------------------------------- Hi Gregg, With regard to the little example script (repeated above), you have solved the problem: 1) In Windows XP, saving the script in ANSI allows the script to run and the display of the word "Florianópolis" to be correct. 2) In Ubuntu, if I save the script in Western (ISO-8859-15) instead of UTF-8, it has a similar correct result when running the script. With regards to my real project, as I explained, my list of client names is loaded in a way which is more complicated than the simple example above suggests. Each client has a text file in a folder, and the file name corresponds exactly to his/her name. The text-list is populated by grabbing the file names from the folder. You may well ask why I choose to do it this way, which might not be the most convenient method in relation to Rebol. The answer is that the original program was written in VB (Windows only), and that I am now trying to write a similar program for Linux. And the reason for that is the fact that I have my client data already established in the Windows version, and I want to transfer it to Linux (or even back to Windows again) without having to change it. In my real project, the client data is grabbed as follows: text-list data read %"names/" The names of the files (clients) are not displayed correctly in Ubuntu (but in Windows they are correct). In Ubuntu, for a correct display in the text-box, how can I do the above read in Western (ISO-8859-15) instead of UTF-8? Bob

 [4/5] from: gregg:pointillistic at: 6-Feb-2008 14:09


Hi Bob, BW> In my real project, the client data is grabbed as follows: BW> text-list data read %"names/" BW> The names of the files (clients) are not displayed correctly in Ubuntu BW> (but in Windows they are correct). BW> In Ubuntu, for a correct display in the text-box, how can I do the above BW> "read" in Western (ISO-8859-15) instead of UTF-8? Maybe Jan Skibinski's UTF-8 script will do what you need: http://www.reboltech.com/library/html/utf-8.html -- Gregg

 [5/5] from: warren:howsoft at: 6-Feb-2008 22:34


Thanks a lot Gregg, I'll look into it. Bob Gregg Irwin wrote:

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted