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

Similar Messages

  • 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.

  • Lync with Microsoft Project 2013

    Hi,
    I have Microsoft Lync 2013 and Microsoft Project 2013.
    Can anyone send me the steps to integrate these two so that i can get the updates from the team members without leaving Microsoft Project?
    K.Gokulraj

    In addition to Ben his answer.
    The integration with Lync is not supported in Project Standard only in Pro & Web App:
    http://blogs.office.com/2012/10/19/project-and-lync-together-reducing-communication-barriers/
    https://technet.microsoft.com/en-us/library/ee683978.aspx
    - Dennis | Netherlands | Blog |
    Twitter

  • Xml payload encoding from utf to iso

    Hi Experts,
    Could you please let me know how can I encode he xml payload from utf-8 to ISO-8859-1.
    its bit urgent any help is appreciated.
    Thanks & Regards,
    Ranganath.

    Hi Ranganath,
    Here is the java mapping for PI 7.1 and above which will transform encoding type from utf-8 to ISO-8859-1.
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import com.sap.aii.mapping.api.AbstractTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.TransformationInput;
    import com.sap.aii.mapping.api.TransformationOutput;
    public class addAttributeToTag2 extends AbstractTransformation {
          * @param args
         public void execute(InputStream in, OutputStream out)
                   throws StreamTransformationException {
              // TODO Auto-generated method stub
              try
                   int c;
                   int count=0;
                   String s="";
                   while(1>0)
                        c=in.read();
                        if(c<0)
                             break;
                        if(count<=2 && (char)c=='?')
                             count++;
                        if(count<=2)
                             s=s+(char)c;
                             if(count==2)
                                  s=s.replaceAll("utf-8","ISO-8859-1");
                                  s=s.replaceAll("UTF-8","ISO-8859-1");
                                  count=3;
                                  out.write(s.getBytes());
                             continue;
                        out.write(c);
                        //System.out.print((char)c);
                   in.close();
                   out.close();
              catch(Exception e)
         public void setParameter(Map arg0) {
              // TODO Auto-generated method stub
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              try{
                   addAttributeToTag2 genFormat=new addAttributeToTag2();
                   FileInputStream in=new FileInputStream("C:\\Apps\\my folder\\sdn\\copy.xml");
                   FileOutputStream out=new FileOutputStream("C:\\Apps\\my folder\\sdn\\copy1.xml");
                   genFormat.execute(in,out);
                   catch(Exception e)
                   e.printStackTrace();
         public void transform(TransformationInput arg0, TransformationOutput arg1)
                   throws StreamTransformationException {
              this.execute(arg0.getInputPayload().getInputStream(), arg1.getOutputPayload().getOutputStream());
    if you are working in PI 7.0 the you need following code
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    public class addAttributeToTag2 implements StreamTransformation {
          * @param args
         public void execute(InputStream in, OutputStream out)
                   throws StreamTransformationException {
              // TODO Auto-generated method stub
              try
                   int c;
                   int count=0;
                   String s="";
                   while(1>0)
                        c=in.read();
                        if(c<0)
                             break;
                        if(count<=2 && (char)c=='?')
                             count++;
                        if(count<=2)
                             s=s+(char)c;
                             if(count==2)
                                  s=s.replaceAll("utf-8","ISO-8859-1");
                                  s=s.replaceAll("UTF-8","ISO-8859-1");
                                  count=3;
                                  out.write(s.getBytes());
                             continue;
                        out.write(c);
                        //System.out.print((char)c);
                   in.close();
                   out.close();
              catch(Exception e)
         public void setParameter(Map arg0) {
              // TODO Auto-generated method stub
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              try{
                   addAttributeToTag2 genFormat=new addAttributeToTag2();
                   FileInputStream in=new FileInputStream("C:\\Apps\\my folder\\sdn\\copy.xml");
                   FileOutputStream out=new FileOutputStream("C:\\Apps\\my folder\\sdn\\copy1.xml");
                   genFormat.execute(in,out);
                   catch(Exception e)
                   e.printStackTrace();
    However as Krish has pointedf out file adapter has option to set encoding type, you can try that option first.
    regards
    Anupam

  • 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.

  • Reverting the Portal Encoding back to UTF-8 from UTF-16

    Hi all
    The portal configuration for encoding is changed to UTF-16 from UTF-8. After the changes the portal logon screen itself is coming with the junk values.
    The changes are made according to the link below.
    <b>File Based Configuration Properties</b>
    http://help.sap.com/saphelp_nw04/helpdata/en/6a/39fb402eb5f76fe10000000a1550b0/content.html
    The changes made are not reflected.
    We can see that the value of the variable(runtime.doubleByteSupport.encoding
    ) is not changed in Visual admin.(Parameter Reporting in the Visual Administrator)
    Can anyone help regarding this isssue...
    Thanks in advance
    Geogi

    Any Help???

  • Encoding from UTF-16 to UTF-8

    Hi,
    I need to convert from UTF-16 to UTF-8 encoding.
    I receive an CSV file in encoding UTF-16 for our backend system. but our external partner needs the encoding to be UTF-8
    How can I change the encoding ?

    Hello Frank,
    We have used TextCodePageConversionBean to meet such a requirement in one of our scenarios using CSV files.
    http://help.sap.com/saphelp_nw04/helpdata/en/45/da2deb47812e98e10000000a155369/content.htm
    Can you please try this and let us know if this helps?
    Thanks.
    Best Regards,
    Shweta

  • Mail Sender - Encoding (I need to change from UTF-8 to ISO-8859-1)

    Hi,
    I'm getting data from email (in ms exchange) using the Mail Sender Adapter.
    In the e-mails exists characters as ç (ccedil), ã (atilde), õ (otilde) and others. The XI cannot read this characters because the encode in XML is UTF-8.
    How I do to change the encode in XI from UTF-8 to ISO-8859-1 ?
    Thank you!

    Unfortunately most mail server do not apply the codepage to the content type of a mail.
    In this case you have to set the content type with help of the MessageTransformBean:
    Transform.ContentType      text/plain;charset="ISO-8859-1"
    Regards
    Stefan

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Searching a string in Microsoft word from a Jav Application

    Would appreciate if you could provide me with an example/ suggestion to search for a string in Microsoft Word document from a java aplication. Thanks

    Short and rude answer: STFW.
    Long and polite answer: If you use "java apache word excel" as the criterium to search the web with Google, the first hit is what we are looking for:
    http://jakarta.apache.org/poi/
    Good luck anyway!

  • Preventing select-string from adding additional undesired strings in the output file

    Hi friends
    in PS 4.0 i am trying to write a function which
    step1: export the list of all eventlogs ----> wevtutil el > "$home\documents\\loglist1.txt"
    step2: deleted the following two lines from loglist1.txt
    DebugChannel
    Microsoft-RMS-MSIPC
    ( the reeson of deleting these two lines is wevtutil cl command, can't clear these two evenlogs among approximately 1000 logs)
    in fact via select-string with -pattern -notmatch parameters, we select anything except these two line
    step3:  pastes the select-string contents into the same file ("$home\documents\loglist1.txt") or into new text file (for example
    "$home\documents\loglist2.txt")
    here is my code:
    function MycleareventsAll {
    cls
    Wevtutil el > "$home\documents\loglist1.txt"
    $mycontents = select-string "$home\documents\loglist1.txt" -pattern DebugChannel, Microsoft-RMS-MSIPC -NotMatch
    cd "$home\documents\"
    $mycontents | out-file loglist2.txt"
    # also i tried ---> $mycontents | set-content "loglist2.txt"# also i tried ---> $mycontents | set-content "loglist1.txt"
    but the problem is, in addition of deletion, unfortunatelly additional strings (filepath, filename, line number) are added into the final text file so wevtutil will fail clearing logs listed in text file.
    here is contents of the final text file
    C:\Users\Administrator\documents\loglist.txt:1:Analytic
    C:\Users\Administrator\documents\loglist.txt:2:Application
    C:\Users\Administrator\documents\loglist.txt:4:DirectShowFilterGraph
    but i need the contents be the same as original file without that two specific line:
    Analytic
    Application
    DirectShowFilterGraph
    i searched but i didn't find a way to prevent select-string cmdlet from adding these edditional strings
    (filepath, filename, line number) into output file while keeping the original contents.
    note: -quiet parameter is not what i want. it removes all contents & simply inserts a true or false.
    any help? 

    don't forget that Guys here know the basics of security such as clearing event logs & ...
    how odd if you don't know this.
    clearing all events is useful in test environment for example when i ma teaching my students & need to see all newly created events & work on them
    Then you are teching your students how not to use an event log.  We use filters and queries to access event logs.  We also use event log CmdLets in PowerShell.  WEVTUTIL is ok but it does not marry wellwith PowerShell as you have seen.
    I have found very few people who are not certified in WIndows administration that know much about eventlogs when it should be a ver important part of administration.  PowerShell has mmade EL management much easier but few take the time to learn how
    to use the EL support in PowerShell.
    I see no point inclearing event logs.  It accomplishes nothing.
    ¯\_(ツ)_/¯
    oh your are introducing me filters & queries in event viewer !! please stop Laughing me this way.
    your problem is you judge about people's knowledge & you persist on your absurd judgments.
    look at your sentence:
    "Then you are teaching your students how not to use an event log" 
    where from you tell this? have you been present in my classes to see what i teach to my students?
    have you seen that i told to my students not to use event viewer?
    my goal of clearing events is related to myself. it's non of your businesses.
    people are not interested to here concurrent irrelevant advises from you like a grandmother. they are searching for a solution. their intent of doing tasks is not up to you.

  • Using Webi to generate report from Microsoft Project?

    Does anyone know if there a way to create a Webi report from Microsoft Project?  Can put me in the right direction towards accomplishing this task?

    Hi,
    For this use Microsoft .Net with Integration of Business Intelligence(BI/BOBJ). Select web I reports with Crystal Reports generation and use in the .Net Project.
    All the Best
    Madhu.....

  • Acrobat 8 Standard crashes when opening PDFs created from  Microsoft Project 2007

    Issue: Acrobat 8 Standard crashes when opening PDFs created from Microsoft Project 2007.
    OS: Win XP Pro SP3
    Error Message(s): None
    Details: This issue happens with multiple Microsoft Project files (including new files), multiple PDF creators (included Acrobat 8 Standard) and on multiple computers. We also tried opening the PDFs in Adobe Reader 8 instead of Acrobat Standard 8. There is no record in the event log on the computers of the application crashes.

    I may have a resolution now...
    I clicked Tools -> Options -> View and turned off Bars and shapes in Gantt views in 3-D" on the advice of someone on a Microsoft Forum. I made three PDFs from three Microsoft Project files (that were having trouble previously) and was not able to get these PDFs to crash when zooming or changing pages. So far so good!
    Regards,
    Josh Gold
    SERA Architects

  • 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

  • HTTP-Receiver: Code page conversion error from UTF-8 to ISO-8859-1

    Hello experts,
    In one of our interfaces we are using the payload manipulation of the HTTP receiver channel to change the payload code page from UTF-8 to ISO-8859-1. And from time to time we are facing the following error:
    u201CCode page conversion error UTF-8 from system code page to code page ISO-8859-1u201D
    Iu2019m quite sure that this error occurs because of non-ISO-8859-1 characters in the processed message. And here comes my question:
    Is it possible to change the error behaviour of the code page converter, so that the error will be ignored?
    Perhaps the converter could replace the disruptive character with e.g. u201C#u201D?
    Thank you in advance.
    Best regards,
    Thomas

    Hello.
    I'm not 100% sure if this will help, but it's a good Reading material on the subject (:
    [How to Work with Character Encodings in Process Integration (NW7.0)|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42]
    The part of the XSLT / Java mapping might come in handy in your situation.
    you can check for problematic chars in the code.
    Good luck,
    Imanuel Rahamim.

Maybe you are looking for

  • Upgrade make my X server hang forever

    Hi all after my last upgrade from kernel 29 to 30 I cannot get into my linux system as my X will not load - it doesn't give me the console login and it won't allow me to use any other ALT+Fn I managed to get into into the logs and this is what I foun

  • Monthly performance report

    Dear All I want to generate Monthly performance report for the QM activity.. as per the below table. Please suggest the right way to create this query. Inspection description            Accepted           Rejected           Rejected %        Under te

  • How to search text content of scanned Documents in DMS

    hello, i need to scan the legacy document and put it in to DMS. After that i want to search the scanned document using the Trex search. I want to know how to achive it as scaaed document are as like images and we can not search the text in images. An

  • Using values from an HTML in a JSP

    Hi, Is it possible to use the values from form entries on a HTML page on a JSP page that gets called when the Submit button is clicked? Thanks!

  • Additional Partner Report

    I have created one additional partner function in Architect in a diiferent account group. Now when i am creating Inquiry/order i am adding this into my partner function. My requirement is how i will get a report on the basis of this new partner funct