Convert String from UTF-8 to IsoLatin1

Hi everyone !
I'm trying to convert a String from utf-8 to IsoLatin1, but i got somt problems.... I'm using
actually this code, but it won't work...
I'm getting a utf-8 html String with some data and i will write it down in latin1 to a text file
String newString = new String(oldString.getBytes("UTF-8"), "ISO-8859-1");If i'm now writing this newString to a TextFile it contains cryptic signs like
& # 1 3 ; or & # 1 3 7 ; or & # 1 2 8 ;(i separated this chars)
can anyone tell me where is my fault and how can i solve this problem ?
Thanks a lot
Edited by: Sephiknight on Feb 23, 2008 2:41 AM

Yes its XML, i got a web editor where i can add input (utf-8) and i want to write it down in my class to a xml file (isoLatin1).
My code looks likte this
     public static void setEditFragment(String content, String xPath) throws Exception {
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         DocumentBuilder builder  = factory.newDocumentBuilder();
         Document document = builder.parse("3001300.xml");
         XPath xpath = XPathFactory.newInstance().newXPath();
         Node node = (Node)xpath.evaluate(xPath, document, XPathConstants.NODE);
        Charset charset = Charset.forName("ISO-8859-1");
        CharsetEncoder encoder = charset.newEncoder();    
        ByteBuffer buf = encoder.encode(CharBuffer.wrap(content));
        node.setTextContent(buf.toString()); 
           // Use a XSLT transformer for writing the new XML file
        Transformer transformer = TransformerFactory.newInstance().newTransformer();
         DOMSource        source = new DOMSource( document );
         FileOutputStream os     = new FileOutputStream("tmp.xml");
         StreamResult     result = new StreamResult( os );
         transformer.transform( source, result ); 
     }The example from http://www.exampledepot.com/egs/java.nio.charset/ConvertChar.html looks great, but if I add my own input string i get a exception that looks like this
java.nio.charset.UnmappableCharacterException: Input length = 1
     at java.nio.charset.CoderResult.throwException(Unknown Source)
     at java.nio.charset.CharsetEncoder.encode(Unknown Source)
     at HagerAbs.setEditFragment(HagerAbs.java:91)
     at HagerAbs.main(HagerAbs.java:108)When i write my input to the xml file it doesnt look like xml at all, it looks more like
<synthese>& # 13;
& # 13;
& lt;br/& gt;& # 13;
& lt;img class="thumb" src="http: ......{code}
(i seperated the char so you can see)
and this is not what i expected... how can i write it down correctly ?
Edited by: Sephiknight on Feb 23, 2008 3:26 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Convert String from ASCII to ANSI

    Hi,
    a command line instruction via LabVIEW function "System Exec.vi" retrieves me a string in ASCII format. Is there a function to convert string from ASCII to ANSII format? I use LabVIEW 8.5 German Installation.
    Kind Regards
    Christian
    Test Engineering
    digades GmbH
    www.digades.com

    Hallo Christian,
    AFAIK there is no such in function in LabView...
    But you can:
    - use "Search and replace string" to search for ASCII chars and replace them by their corresponding ANSI char, do this in a loop for all chars to be replaced (acceptable speed for small strings...)
    - convert the string to an U8 array and use a lookup table to convert all bytes from ASCII to ANSI, convert back to string (may be faster for long strings...)
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Regarding Converting file from UTF-8 encoding to ANSI

    Hi Experts!
    I have a problem that my given file is in encoding UTF-8 and i have to convert it into ANSI first so that i can use my bdc session to upload the file.
    Kindly if you can help me out with that.If there is any fm available to do that.
    thanks in advance
    jawad

    hi Jawad,
    place the matter u want to convert in the c program given in the following link it will solve your problem
    http://www.codeguru.com/forum/archive/index.php/t-288665.html
    Reward if useful

  • Converting string from file to array

    I'm new to LabVIEW and have been thrown into the middle of a project, so I need to get some code working fast! Can someone help me understand why the VI I've attached isn't working? I want to have a text file that contains a list of integers that will be used to reference particular elements in arrays within my program. I tried to follow an example I found, but the output that should be an array is coming out as a scaler. Any help would be super appreciated! Thanks!
    Solved!
    Go to Solution.
    Attachments:
    string_to_array.vi ‏9 KB
    exp.txt ‏1 KB

    First, let's explain the reason for your error: The reason why it's happening is that you're trying to do two different things at the same time. You're auto-indexing the array and you're trying to index the array inside the loop. When you wire an array to a for loop it auto-indexes the loop. Meaning LabVIEW knows how many times to run the loop - there is no need to wire to the N terminal. Also, the wire inside the loop will be an instance of the element of the array, not the array. So, the wire inside the loop is a scalar. Thus, the reason for the broken wire - you can't index a scalar.
    Also, I'm not sure what you're trying to do with the indexing of the one element of the cluster. The cluster is empty, so there's nothing to index. Presumably the file is there to tell you which elements to pull out from the "Amp2" array from the cluster. If so, remember that auto-indexing works both ways. If you connect an "outbound" wire to the edge of a loop it auto-indexed there as well, meaning the output will be an array.
    Please read the LabVIEW Help on auto-indexing.
    Now, given all of that, here is what your code should look like:
    Note the use of the Read From Spreadsheet File VI. It makes your life easier.
    Attachments:
    fixed code.png ‏22 KB

  • Encoding from UTF-8 encoded String to Microsoft Project default encode

    Hi Expert ...
    I have a problem with encoding a String from UTF-8 String in order to write a MPX (Microsoft Project) file. I used UTF-8 on my Database encoding, and I want to write a MPX file using MPXJ library, but the result is (?) character. I think it's because I didn't encode yet to Shift JIS (a Microsoft Product default encoding). And after that I try to encode the String with Shift_JIS encoding, but the same result is appeared. I try to looking another way, but there is no result.
    I hope some expert would help me to solve this problem.
    Thank you,
    Alfian B.

    Totally wrong. A String doesn't have an encoding.
    Now if you had an array of bytes, which were encoded using one charset, and you wanted to convert that to an array of bytes encoded using a second charset, you would use code like this:byte[] bytes = // the bytes encoded in UTF-8, let's say
    String s = new String(bytes, "UTF-8"); // make that into a String
    byte[] newbytes = s.getBytes("windows-31j"); // encode the String into windows-31j

  • Gdk-WARNING **: Error converting from UTF-8 to STRING

    I just installed Arch64 few days ago. In my old setup I was used to work with 2 softwares: Eclipse CDT and WingIDE.
    I tried to start these applications (they require java and python but they are binary releases) locally and I get this errors which I can't solve by myself googling... Reporting snapshots of my desktop too.
    [j_zar@Surprise eclipse]$ ./eclipse
    (eclipse:7864): Gdk-WARNING **: Error converting from UTF-8 to STRING: Impossibile aprire il convertitore da "UTF-8" a "ISO-8859-1"
    (eclipse:7864): Gdk-WARNING **: Error converting from UTF-8 to STRING: La conversione del set di caratteri da "UTF-8" a "ISO-8859-1" non è supportata
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: Failed to load Pango module '/usr/lib/pango/1.6.0/modules/pango-basic-fc.so' for id 'BasicScriptEngineFc'
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: pango_shape called with bad font, expect ugly output
    (eclipse:7864): Pango-WARNING **: pango_font_get_glyph_extents called with null font argument, expect ugly output
    (eclipse:7864): Pango-WARNING **: pango_font_get_metrics called with null font argument, expect ugly output
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Gdk-WARNING **: Error converting from UTF-8 to STRING: La conversione del set di caratteri da "UTF-8" a "ISO-8859-1" non è supportata
    (eclipse:7864): Gdk-WARNING **: Error converting from UTF-8 to STRING: La conversione del set di caratteri da "UTF-8" a "ISO-8859-1" non è supportata
    (eclipse:7864): Gdk-WARNING **: Error converting from UTF-8 to STRING: La conversione del set di caratteri da "UTF-8" a "ISO-8859-1" non è supportata
    (eclipse:7864): Gdk-WARNING **: Error converting from UTF-8 to STRING: La conversione del set di caratteri da "UTF-8" a "ISO-8859-1" non è supportata
    (eclipse:7864): Gdk-WARNING **: Error converting from UTF-8 to STRING: La conversione del set di caratteri da "UTF-8" a "ISO-8859-1" non è supportata
    (eclipse:7864): Pango-WARNING **: pango_cairo_font_get_scaled_font called with bad font, expect ugly output
    [j_zar@Surprise wingide]$ ./wing
    (wing.py:7922): Gdk-WARNING **: Error converting from UTF-8 to STRING: Could not open converter from 'UTF-8' to 'ISO-8859-1'
    (wing.py:7922): Gdk-WARNING **: Error converting from UTF-8 to STRING: Conversion from character set 'UTF-8' to 'ISO-8859-1' is not supported
    Anybody can help in this???
    Last edited by J_Zar (2007-10-30 11:48:28)

    There has been talk about adding these config files, that fixes this kinda problems, to a separate pkg with a helper script you run 32bit programs with.
    for quick fix
    Link
    Grab the 3 pango files, throw them somewhere, edit pangorc to corresponding paths for the 2 other files.
    Start program with
    export PANGO_RC_FILE="/path/to/pangorc"
    program
    for the string error, if its iconv
    export GCONV_PATH=/opt/lib32/usr/lib/gconv
    to previous command
    Note, you cant start 64bit programs that use pango/iconv from the terminal you exported the variable.

  • How to convert a String to UTF-8?

    I get user data from a JTextField using getText() method.
    But I want to convert it into UTF-8 in order to update Ms SQL2000.
    Can anybody give me a clue how to do it?

           String a = ...
           try
               byte[] b = a.getBytes("UTF8");
           catch (Exception e)
               System.out.println("caught" + e);
               e.printStackTrace();
           }

  • Need to convert  Date from calendar to String in the format dd-mom-yyyy

    Need to convert Date from calendar to String in the format dd-mom-yyyy+..
    This is absolutely necessary... any help plz..
    Rgds
    Arwinder

    Look up the SimpleDateFormat class: http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
    Arwinder wrote:
    This is absolutely necessary... any help plz..For you maybe, not others. Please refrain from trying to urge others to answer your queries. They'll do it at their own pace ( if at all ).
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

  • Converting string(which is an xml from the java side) to xml in flex

    Hi,
       I have an xml from the java side which i send as string over amf. I need to convert this to xmllist or xml and bind it to a tree. Could some one help me in doing this. My label field needs to be displayName
    this is my xml that comes as string to the flex side
    <Menu>
      <MenuItem>
        <id>1</id>
        <displayName>Add</displayName>
        <menuList>
          <MenuItem>
            <id>3</id>
            <displayName>Form1</displayName>
            <menuList/>
          </MenuItem>
          <MenuItem>
            <id>4</id>
            <displayName>Form2</displayName>
            <menuList/>
          </MenuItem>
        </menuList>
      </MenuItem>
      <MenuItem>
        <id>2</id>
        <displayName>Delete</displayName>
        <menuList>
          <MenuItem>
            <id>5</id>
            <displayName>Form1</displayName>
            <menuList/>
          </MenuItem>
          <MenuItem>
            <id>6</id>
            <displayName>Form2</displayName>
            <menuList/>
          </MenuItem>
        </menuList>
      </MenuItem>
    </Menu>

    Well, for Binding you will probably need to further convert to XMLListCollection or ArrayCollection.
    Not sure.
    However, that is the way to convert String to XML.

  • Convertion from UTF-16 to UTF-8 in XI

    Hi,
      From Source system (MDM), sometimes data are coming in UTF-16 format in to XI. My target system is R/3 which is UTF-8. Here's the scenario:-
    MDM->MQ Queue-> Local JMS Queue-> XI->R/3
    Here I am using sender JMS Queue adapter to receive the data from Local JMS Queue and using receiver IDOC adapter to send the IDOC into R/3. I am using ABAP mapping for this scenario.
      Since the target system in UTF-8 and the data are coming sometimes in UTF-16, how can I change the format UTF-16 to UTF-8 in sender JMS adapter.
    Please advice.
    Reply with details would be appreciated.
    BR
    Soumya

    Hi Soumya ,
    You can do this in Adapter module in JMS sender adapter .
    obj = inputModuleData.getPrincipalData();
    msg = (Message) obj;
    XMLPayload xmlpayload = msg.getDocument();               
    xmlpayload.getContent()
    convert from UTF 16 to UTF 8 then
    xmlpayload.setContent();
    Hope this works.
    Cheers,
    Reddy

  • Pacman: Pathname can't be converted from UTF-8 to current locale

    Hello Forum,
    I am stuck with a problem to which I cannot find any solution after spending half the day trying to solve it:
    I have a package wich I installed from AUR -> MyCustomRepository working nicely on my main Arch system. Now I would like to add the package to a livecd using the archiso scripts. When I add it to my packages.both list it downloads fine.
    However when installation into chroot should start pacman gives me the following error:
    (378/378) loading package files [######################] 100%
    error: error while reading package /var/cache/pacman/pkg/pd-extended-0.43.4-1-x86_64.pkg.tar.xz: Pathname can't be converted from UTF-8 to current locale.
    error: failed to commit transaction (libarchive error)
    Errors occurred, no packages were upgraded.
    My System only uses en_US.UTF-8 as locale, so I don't really understand why any conversion should be neccesary.
    I read about a similar error somewhere with a reply stating it had  to do with packaging. No solution was given however. Can this be the case? And if yes, why do I not have any problems installling in my main system? And more importantly, how can I fix it? i don't really know where to look for the right way now.
    I already tried to include a different packages from AUR through my repository, which worked as expected.
    the package is pd-extended from AUR with a slight modification to make the .desktop file actually start pdextended.
    Any help is greatly appreciated.
    Thank you,
    Dominik
    # Maintainer: <fero dot kiraly at gmail.com>
    # Contributor: Dominik Schmidt-Philipp <[email protected]>
    pkgname=pd-extended
    pkgver=0.43.4
    pkgrel=1
    pkgdesc="PureData Extended 0.43-4 version"
    url="http://puredata.info/"
    arch=('i686' 'x86_64' )
    license=('BSD')
    depends=('libdc1394' 'desktop-file-utils' 'libiec61883' 'fftw' \
    'jack' 'tk' 'freeglut' 'libquicktime' 'libdv' 'gsl' 'imagemagick' \
    'ftgl' 'libgl' 'hicolor-icon-theme' 'lua51')
    makedepends=('dssi' 'git' 'libv4l' 'tcllib' 'subversion' 'swig' 'automake' 'curl')
    conflicts=('pdp' 'zexy' 'puredata')
    provides=( 'pd-extended' 'pd-gem' 'pdp' 'zexy')
    optdepends=('puredata-utils' 'pd-vanilla')
    replaces=(pd-extended)
    backup=()
    options=('!makeflags' '!libtool')
    install=pd-extended.install
    source=('change_gem_configure_file.patch' 's_inter.c.patch' 'tclpd.Makefile.patch' 'makefile.am.patch')
    md5sums=('63a36c51706eaed98611aa4b4bb6ed0d' '8b748d09e8bdf04540ba579d0a6b5318' '463de23166cef2dcf6c7f6989e636213' '5938b12a232004de15f5a383f95cedca' )
    build() {
    unset CFLAGS
    unset LDFLAGS
    unset INCLUDES
    #downloading pd-extended----------------------------------------------------------
    msg "Begin SVN checkout for pd-extended 0.43.4"
    cd $srcdir
    svn checkout https://pure-data.svn.sourceforge.net/svnroot/pure-data/branches/pd-extended/0.43 $pkgname
    msg "SVN checkout done or server timeout"
    cd ..
    #FIXES -----------------------------------------------------------------------------
    # fix #1 lua
    #patch $srcdir/$pkgname/externals/loaders/pdlua/src/Makefile ./repair_lua_lib_number.patch
    #fix #2 -- GEM configure.ac
    patch $srcdir/$pkgname/externals/Gem/configure.ac ./change_gem_configure_file.patch
    #fix #3 -- repair wish8.6 (for tcl8.6)
    patch $srcdir/$pkgname/pd/src/s_inter.c ./s_inter.c.patch
    #fix #4 -- repair version of tcl (8.6)
    patch $srcdir/$pkgname/externals/loaders/tclpd/Makefile ./tclpd.Makefile.patch
    #fix #5 -- repair binary name to pd-extended (from pd)
    #patch $srcdir/$pkgname/packages/Makefile ./program_name.patch
    patch $srcdir/$pkgname/pd/src/Makefile.am ./makefile.am.patch
    # 64 bit archutecure----------------------------------------------------------------
    if [ "$CARCH" = "x86_64" ]; then
    # fix -fPIC issue in PDP
    sed -e "s|CFLAGS =|CFLAGS = -fPIC|" \
    -i $srcdir/$pkgname/externals/pdp/opengl/Makefile.config || return 1
    # fix -fPIC issue in pddp
    sed -e "s|DEFINES =|DEFINES = -fPIC|" \
    -i $srcdir/$pkgname/externals/miXed/Makefile.common || return 1
    # setting additional variable
    FPIC_FLAG="-fPIC"
    else FPIC_FLAG=""
    fi
    #MAKE --------------------------------------------------------------------------
    cd "$srcdir/$pkgname/packages/linux_make" || return 1
    make BUILDLAYOUT_DIR=$srcdir/$pkgname/packages \
    GEM_EXTRA_CXXFLAGS="$FPIC_FLAG" \
    prefix=/usr \
    install || return 1
    package() {
    cp -urv $srcdir/$pkgname/packages/linux_make/build/usr $pkgdir/
    mv $pkgdir/usr/share/man/man1/pd.1 $pkgdir/usr/share/man/man1/pdextended.1
    rm $pkgdir/usr/share/man/man1/pdreceive.1
    rm $pkgdir/usr/share/man/man1/pdsend.1
    rm $pkgdir/usr/include/m_pd.h
    rm $pkgdir/usr/bin/pd-gui.tcl
    cd $srcdir/$pkgname/
    # PD License
    install -Dm644 pd/LICENSE.txt $pkgdir/usr/share/licenses/pd-extended/LICENSE.txt
    cd packages/
    install -p linux_make/default.pdextended $pkgdir/usr/lib/pd-extended/
    # Gnome menu support
    install -d $pkgdir/usr/share/icons/hicolor/128x128/apps
    install -p -m0644 linux_make/pd-extended.png $pkgdir/usr/share/icons/hicolor/128x128/apps/
    install -d $pkgdir/usr/share/icons/hicolor/48x48/apps
    install -p -m0644 linux_make/48x48/pd-extended.png $pkgdir/usr/share/icons/hicolor/48x48/apps/pd-extended.png
    install -d $pkgdir/usr/share/applications/
    install -p linux_make/pd-extended.desktop $pkgdir/usr/share/applications/
    sed -i "s/^Exec=.*/Exec=pdextended/" $pkgdir/usr/share/applications/pd-extended.desktop
    # mime
    install -d $pkgdir/usr/share/mime/packages/
    install -p linux_make/pd-extended.xml $pkgdir/usr/share/mime/packages/
    install -d $pkgdir/usr/share/icons/hicolor/128x128/mimetypes
    install -p linux_make/text-x-puredata.png $pkgdir/usr/share/icons/hicolor/128x128/mimetypes
    # files for /etc
    cd "$srcdir/$pkgname"
    install -d $pkgdir/etc/bash_completion.d/
    install -p scripts/bash_completion/pd $pkgdir/etc/bash_completion.d
    # emacs mode for .pd files
    install -d $pkgdir/usr/share/emacs/site-lisp/
    install -p scripts/pd-mode.el $pkgdir/usr/share/emacs/site-lisp/
    # Pd-related scripts
    install -p scripts/pd-diff $pkgdir/usr/bin/
    install -p scripts/config-switcher.sh $pkgdir/usr/bin/
    # vim:set ts=2 sw=2 et:

    I chroot into workdir. uncommented en_US.UTF-8 in /etc/locale.gen, run locale-gen and now get this inside the chroot.
    [root@dArch2 releng]# chroot work/x86_64/root-image/
    [root@dArch2 /]# locale
    LANG=en_US.UTF-8
    LC_CTYPE="en_US.UTF-8"
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_COLLATE="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_MESSAGES="en_US.UTF-8"
    LC_PAPER="en_US.UTF-8"
    LC_NAME="en_US.UTF-8"
    LC_ADDRESS="en_US.UTF-8"
    LC_TELEPHONE="en_US.UTF-8"
    LC_MEASUREMENT="en_US.UTF-8"
    LC_IDENTIFICATION="en_US.UTF-8"
    LC_ALL=
    this looks alright to me. Any more suggestions?
    It's the first time I use a custom-repo and I set it up only for this purpose. So yes, it's up to date and can be used outside the chroot. Also a different package I put from AUR into my custom-repo installs fine and doesn't give this error.
    How else could I test the custom-repo?

  • Unable to convert from "UTF-8" during oracle upgrade

    Hi,
    I'm trying to upgrade from 9.2.0.1 to 9.2.0.6, while running the runInstaller, am getting the following error:
    ERROR: Unable to convert from "UTF-8" to "ISO-8859-1" for NLS!
    SuSE-7, redhat-2.1AS, redhat-2.1, UnitedLinux-1.0, redhat-3 or SuSE-8
    can anyone tell me how to fix this problem?
    thanks,
    GK

    Hi Vinod,
    I have already checked that and found the package is available in my system.
    <i># pkginfo - SUNWuiu8
    system      SUNWuiu8 Iconv modules for UTF-8 Locale</i>
    Regards,
    Chintan Sheth

  • How to convert a string from upper case to lower case in FOX formula

    Hi Experts,
    How to convert a string from upper case to lower case in FOX formula?
    Thanks,
    Cheers!!!
    PANKAJ

    The last result.append( c ) should be:
    result.append( Character.toLowerCase(c) );

  • How to convert a string from lower case to upper case withour using transla

    Hi all,
    how to convert a string from lower case to upper case withour using translate,
    Thanks in Advance,
    Reddy

    Refer to this related thread
    Re: hi guys this very urgent please help

  • Change character encoding from UTF-8 to EUC-KR

    We are receiving data in UTF-8 in the querystring from a partner formatted as:
    %EA%B3%A0%EB%AF%BC%ED%95%98%EC%9E%90%21
    Our site uses EUC-KR so using this text for search/display/etc is not possible. Does anyone know how we can convert this to the proper Korean EUC encoding so it can be displayed properly using JSP? Basically it should be:
    %B0%ED%B9%CE%C7%CF%C0%DA%21
    Thanks in advance.

    I'm not sure where you are getting %xx encoded UTF-8.... Is it cuz you have it in a GET method form and that's what you are seeing in the browser's location bar? ...
    Let's assume you have a form on a page, and the page's charset is set to UTF-8, and you want to generate a URL encoded string (%xx format, although URLEncoder will not encode ASCII chars that way...).
    In the page processing the form, you need to do this:
    request.setCharacterEncoding("UTF-8"); // makes bytes read as UTF-8 strings(assumes that the form page was properly set to the UTF-8 charset)
    String fieldValue = request.getParameter("fieldName"); // get value
    // the value is now a Unicode String in Java, generated from reading the bytes submitted from the form as UTF-8 encoded text...
    String utf8EncString = URLEncoder.encode(fieldValue, "UTF-8");
    // now utf8EncString is a URL encoded (%xx) string of UTF-8 values
    String euckrEncString = URLEncoder.encode(fieldValue, "EUC-KR");
    // now euckrEncString is a URL encoded (%xx) string of EUC-KR valuesWhat is probably screwing things up for you mostly is this:
    euckrValue = new String(utf8Value.getBytes(), "EUC-KR");
    What this does is takes the bytes of the string utf8Value (which is not really UTF-8... see below) in the local encoding (possibly Cp1252 (Windows) or ISO8895-1 (Linux), or EUC-KR if it's Korean Windows), and then reads them as if they were EUC-KR... which they aren't.
    The key here is that Strings in Java are not of any encoding. They are pure Unicode values. Encodings only matter when converting to or from bytes. The strings stored in a file or sent over the net have to convert to bytes since that's what is stored/sent, just bytes. The encoding defines how the characters can be encoded into 1 or more bytes, and thus reconstructed.

Maybe you are looking for

  • Menu bar items open and close quickly on first click

    Hi, I am running 10.8.2 and recently when I select an item from the menu bar or an application menu the menu folder flashes on and off very quickly for the first time, and I need to select it again to get it to open properly. Has anyone expereinced t

  • Giving away free apps that are for purchase

    Curious if it's possible to give away certain paid apps for free for specific promotions by use of gift cards or another means... has anyone done anything like this before?

  • A question regarding Java project in ECLIPSE IDE

    A question regarding eclipse. No offence meant. I have added a jar file to the current project in its build path. This executes the concerned class file which is in the jar file. If I remove the jar file from the build path and run the project, it st

  • OSB Routing Options for JMS Proxy

    Hello! My config: WS Proxy Service -> <jms queue> ->Proxy Service -> WS Service jms queue used for guaranteed delivery of msg. I wanna dynamically change retry interval and retry count. Does Configuration Routing Options in Proxy Service (Retry Inter

  • Custom brush strokes in AE?

    I have ideas for animation with fancy brush strokes.  Brush strokes i know i have in photoshop.  But from what i have found thus far, I am not able to bring in Photoshop brush stokes into AE.  Does anyone know the best solution to animate with brush