StringByAddingPercentEscapesUsingEncoding encoding differently

Hi,
I have an Objective-C function that URL encodes data to be sent to a Dav server. Sometimes it encodes properly, sometimes it doesn
NSString *URLEncode(NSString * url)
  NSString* sUrlCopy = [[NSString alloc] initWithFormat:@"%@",url];
  return [sUrlCopy stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
sometimes if I call it as URLEncode(@"/XæøåX.txt");
I'll get the proper encoding of ENCODED=/X%C3%A6%C3%B8%C3%A5X.txt
Sometimes though, I get back ENCODED=/X%C3%A6%C3%B8a%CC%8AX.txt
Decoding both of these gives me the same source though.
does the "ø" character have different unicode values? how can I get a consistant URL encoded value to send to web servers?
Thanks!

Hi,
Yes our program is breaking because of this. Our filesystem will retrieve a list of files from the DAV server, those filenames are UTF-8 encoded as they come over the wire from the server based on the unicode composition of the characters on the remote NTFS drive. We decode the filenames returned from the server and then return them to OSX. At some later point in time, OSX (Finder) will need to know the attributes of a file, so it calls in to us through attributesOfItemAtPath and will send in the decomposed version of the precomposed filename that we gave back to them moments earlier.
The problem happens becuse the DAV server has returned us a UTF8 encoding based on the precomposed filename as it lives on the server. We've decoded it and returned the precomposed filename to the OS. Somehow, from the time we've returned it to the OS and the time the OS sends it back into us for more processing, it has now become a decomposed filename.
Since we honor the filename composition, we UTF8 encode it, send it to the DAV server, and the server responds with File Not Found, because NTFS was doing a lookup on the decomposed version instead of the precomposed version.
Granted it could be a server problem and the server should figure it out, but OSX is doing something with the precomposed filenames it receives. It's decomposing them and sending them back to us.

Similar Messages

  • Adobe Media Encoder different audio file to video file.

    Hello,
    I've been encoding files from several different DVD's and when I play the encoded file the video is correct but the audio is from a completely different file. This is I am assuming is because the file names on the DVD's are the same i.e. VTS_01_1.. etc. When I realised it was doing this I permanently deleted the incorrectly encoded files, sorted all of the correctly encoded files into seperate folders for each DVD. This did not work even though media encoder was creating new file names for each file it encoded. I then re-named all of the correct files and re-named the files that I was about to encode. I have also cleared the media cache database. The files on the DVD's are fine and play as they should with the correct audio. What do I need to do to get the files to encode with the correct audio?!!! Thank you!

    Try this - in Project Bin, right-click the clip in question and select "Make Offline". Then right-click again and choose "Link Media" and point it to the correct source file. Could be that the pointers got all confused as like you said, as sources had the same names.
    If that fails to resolve the problem - cleaning the Media Cache only works for projects that no longer exist, or are on a drive that is disconnected. Assuming that maybe the Conformed audio that is being used in the background is messed up, try this - close Premiere, then RENAME the project file, for instance add an "x" to beginning of filename. Now open Premiere (new project), then clean the cache again. Since it can't find your project, it should then remove all temp renders from the drive for that project.
    Next, rename project to original name and open and it should conform audio again as if just adding media for the first time. Hopefully for correct clips this time, if you have moved media around on drive to eliminate overlap of file names.
    Jeff Pulera
    Safe Harbor Computers

  • Encoding different file types to binary

    Hi, im writing an application which takes different file types and then encodes them to be sent down a noisy channel, after random effects the data must be decoded back to binary. I have done the algorthims for encoding and decoding binary but i dont know how convert the file types to binary. (files such as jpgs and mp3 and txt)

    ...i know how to do the encoding on binary ...
    ...im not sure how to do this...Maybe you could start by explaining the problem in detail to yourself such that you understand it, then come back and tell us.
    Are you concerned about a difference between a JPG file vs a text file? Text files, in the context you are describing, can be treated as binary just as easily. Use a FileInputStream to read it and you get bytes just like any other file.

  • SAX and DOM - treating encoding differently ??

    Hello!
    I have run into a strange problem - I was parsing my xml document using
    WebLogic's DOM and SAX parsers to compare their performance, and I found
    that while using their DOM parser I was able to parse the document just
    fine, using the SAX parser gave me an error:
    org.xml.sax.SAXParseException: Declared encoding "UTF-8" does not match
    actual one "ISO8859_1"
    I don't use any extended characters in the xml document, and even if I
    did - I'm puzzled as to why DOM parser would process it without
    complaining but the SAX paser would not??
    Thanks,
    Marina

    Hello!
    I have run into a strange problem - I was parsing my xml document using
    WebLogic's DOM and SAX parsers to compare their performance, and I found
    that while using their DOM parser I was able to parse the document just
    fine, using the SAX parser gave me an error:
    org.xml.sax.SAXParseException: Declared encoding "UTF-8" does not match
    actual one "ISO8859_1"
    I don't use any extended characters in the xml document, and even if I
    did - I'm puzzled as to why DOM parser would process it without
    complaining but the SAX paser would not??
    Thanks,
    Marina

  • Encoding Different Quality Videos

    I have created a new project with two video clips.  One video clip was encoded as 4K (3840x2160@~39Mbps) MP4.  The second clip was encoded as 1080P@~9Mbps MP4.  I have have adjusted the two clips to be the same size within a new project (3840x2160).
    Question 1: When I encode this new video at 3840x2160, how does Adobe Premiere handle the lower quality video clip?  Does it average the YUV to in effect upconvert it?  Does it leave it native and the 4K native, yet maintain the edited resolution?  Understanding this would be helpful.
    Question 2: Depending on the answer to the first question, is there a way to maintain the intrinsic quality levels of both videos yet changing the scale of the 1080P video?
    Thank you in advance for the feedback.
    Regards,
    Daryl

    1. This depends on what you've done with the clip in the sequence.  If you scaled it, then PP will apply a scaling algorithm to the 1080 for the 4K output.  Which one depends on a few factors.
    https://blogs.adobe.com/premierepro/2010/10/scaling-in-premiere-pro-cs5.html
    2. No.  You lose quality when scaling, so assuming you want to see the entire image without any surrounding black, one of them will be degraded.  Having said that, the degradation of the 4K outputting to 1080 will be much less noticeable than upscaling the 1080 to 4K.

  • Encoding settings once and for all

    I am often hired to create DVDs consisting of video and stills set to music. When I set the encode too low, the quality (particularly in areas of motion) look less than satisfactory, yet if I set them too high, dissolve transitions look ratty. Has anyone come up with the ideal setting for splitting the difference? And what about encoding scheme—One Pass or one of the VBR modes?

    There's no such thing as a one perfect setting when encoding video. You need to consider a number of factors and you have already found a few - fades, pans, dissolves, fast action, etc all need careful encoding but it depends on the quality of the source footage as to just what settings those will be.
    In general, you can encode different sections at different rates if you split your footage into chunks and encode it separately. You can then reassemble it on the DVDSP time line.
    2 pass VBR is a more accurate encode than 1 pass, but occasionally a CBR encode gives better results (again, it depends on the footage). In general, a 2 pass VBR encode with a maximum of 7.4 and an average of about 5 or 5.5 will cope with most things, but this is by no means a standard setting. You need to experiment with short sections of footage at different bitrates until you get the result you want, then encode it all at the optimum settings.
    Different encoders work in different ways and you should investigate others to use. BitVice is a very good encoder, as is MegaPEG.X - the two work in different ways but are both Mac based. Alternative PC encoders are often very good, but rarely low cost. Look up Cinemacraft, Canopus Procoder and TMPGEnc. for a start.

  • Character encoding in xhtml

    Are there chars in utf-8 that xhtml doesn't handle?
    Does setting the root element's 'lang' attributes limit the
    use of the utf-8
    chars, as if each lang value is a subset of utf-8? E.g.
    <html xmlns="
    http://www.w3.org/1999/xhtml"
    xml:lang="en" lang="en">Will this
    limit the valid chars as a subset of utf-8 (if utf-8 that was
    the encoding
    specified)?If so, is there a list somewhere of what chars
    xhtml will handle
    and what the lang value does to limit any utf-8 chars? Thanks
    Cheers,
    Lossed
    __when the only tool you have is a hammer, everything looks
    like a nail __

    As it's not my site, I'm not sure how to find that out. I
    suspect it's a M$
    flavour given the sever scripting is asp.net and server is
    IIS.
    it just struck me as odd the page encoding would be utf-8 but
    the db would
    be encoded differently so as to replace some chars with "?".
    I tried a few diff column encoding options in MySQL to see if
    I could
    replicate it, but I couldn't. It is no biggie, just a
    curiosity.
    "Michael Fesser" <[email protected]> wrote in message
    news
    [email protected]..
    > .oO(Lossed)
    >
    >>Was wondering why, despite utf-8 encoding, inserts
    into a db where not
    >>displaying some character entities.
    >
    > What DB are we talking about?
    >
    > Micha

  • How to handle  spcial different  character  in

    Hi ,
    I  am dealing with EDI data  and I am taking as input and creating out put as xml 
    but when I am opening the file in  XML spy its gving some error  like.
    " Your file contains two (2)  characters thats should not be present in the file as  using the Unicode UTF-8  encoding/
    The offending characters are : 
    ä (0xE4), ® (0xAE)
    let me know how to handle.
    regards
    ram

    Hi Ram,
    the question is how do you exactly create the file and what is your type  of the  system (Unicode or Non-Unicode) in which you created it  ?
    The content of the file is Non-Unicode (ISO-8859-1):
    E4 = U+00E4 : LATIN SMALL LETTER A WITH DIAERESIS
    AE = U+00AE : REGISTERED SIGN
    However XML expects UTF-8 by default and there the special characters are encoded differently.
    Best regards,
    Nils Buerckel
    SAP AG

  • "Unknown error" when encoding embedded Closed captioning  in premiere pro cc

    I edit for a TV show and i Need closed captioning in my show. When ever i go to export the video and embed the Closed captioning in the video i get a "unknown error" when its almost done encoding. different spots every time. I never have issues when encoding videos with out Closed Captioning. I'm using a custom built 64bit pc. Does any one know how to fix this or an affordable software that can Embed fcc compliant captioning?

    Thanks for the reply --
    Some questions:
    Where are the closed caption files coming from?
    What software made the closed caption files?
    Are you having problems with all the closed caption files you try to use?
    Can you share a problem file?
    Thanks! CM

  • Media encoder via satellite

    Hi,
    I'd really appreciate anyone's help with this.  Please keep in mind that I'm a newbie at this, so try not to get too technical, thanks !
    I'm hooked up to the internet with a satellite connection which achieves an average of 7.5mps up and 1.75 download speed.
    This should be more than adequate to be able to stream video via the Flash Media Encoder, yet it doesn't seem to work.  It keeps considering my speed as too slow.
    This is probably due to the typical "latency" which satellite connections have (ping is slow).
    Is there a way around this by configuring the Flash Media Encoder differently without having to sacrifice the quality of the image ?
    Thank you very much,
    cheers,
    PATRICK

    Hi Vibsgupta,
    First of all, thanks for wanting to help me out !
    I’ve kept all settings in Flash Media encoder as they are set standard except for these (I’ve copy/pasted what I was told to do by the company I’m working for) :
        Format: H264
        Framerate: 12 fps (if your upload speed is above 0.8Mb/s you can go up to 15)
        Input size: 640x480 (check the Maintain aspect ratio box)
        Bit rate: 650 kbps (if your upload speed is above 0.8Mb/s you can go up to 800)
        Output size: 640x480
        Profile: Main
        Level: 3.0
        Keyframe Frequency: 5 seconds
    - Check the Deinterlace box at the bottom.
    - Check the "Audio" box and select your microphone device.
        Format: Mp3
        Channels: Mono
        Sample rate: 11025
        Bit rate: if it's already under 20, you can leave it this way.
    - For preview, make sure the "Input Video" box is unchecked
    - Check "Output Video" and "Audio" box
    - Select output in the Panel options dropdown and follow the following instructions for the different fields:
        Make sure "Stream to Flash Media Server" is checked
        Delete all text in FMS URL, Backup URL and Stream fields
        Check "Auto Adjust"
        Uncheck "Save to File"
    I hope this is enough info for you to help me out !  What is happening now is that the media encoder looks perfect on my screen, but the people “on the other end” see my image in “shocks” which they (non-specialists) say may have something to do with either the latency or the stream (I’m a newbie).
    Thanks again !!!

  • Encoding JPEG images

    In my application, I have to encode different image and save
    them to disk. I tried using JPEGEncoder but it's slow (hangs the
    application while being executed). I tried JPEGAsyncEncoder but it
    has a memory leak
    http://blog.paranoidferret.com/index.php/2007/12/11/flex-tutorial-an-asynchronous-jpeg-enc oder/
    Any suggestions on what to try next ? I use Javascript/HTML
    on adobe AIR.

    Hi,
    Well, you could try fixing the memory leak in
    JPEGAsyncDecoder. :)

  • FLV encoding

    I want to have video on my website by allowing the users to
    upload their own videos to the site. Right now we are allowing
    upload of .avi and .mpeg files using the embed tag. The problem
    with this method is that it is incompatible with most browsers
    namely mozilla. It seems to work ok with IE but not any others. My
    question is this, can FMS encode different video file formats like
    .avi, .mpeg, .mov etc into .flv on the fly during upload or do I
    have to encode them myself and then re upload them to the
    server?

    FMS cannot transcode video.
    If you want to automate the conversion process, look into on2
    flix engine or FFMPEG.

  • I cannot pick different transcode settings

    Hi everyone.
    For some reason i cannot pick different transcode settings. When I go to file>transcode>transcode settings everything is greyed out.
    I have 1 timeline with DV .avi footage that I've imported from Premiere.
    Anyone else have this problem or am I doing something wrong?

    >So does this mean I can transcode different sections of the DVD at different transcode settings?
    Absolutely you can. Every timeline can be encoded differently.
    >And do I have to pick a transcode setting for each clip because I have 4 different clips or can I just set it so that it will transcode all 4 clips at the same settings?
    Yes you can, and yes you can! It's your call.
    If you leave everything at the default setting of "Automatic", Encore generally does a pretty fine job of getting the most quality possible from your AVI files.
    However.
    There may well be cases where you want to maximize the bitrate of, say, the main movie or main timeline at the expense of perhaps the bloopers reel. This is common practise.
    There is a major GOTCHA waiting here though, and that is MPEG-2 encoding is an art form, and best results are not usually obtained from custom presets unless you really know & understand
    i exactly
    what you are doing. Hollywood will employ people to specifically sit there & encode video to MPEG-2 all day, every day. Applications like CCE-SP can even set different bitrates in a single clip by using timecode references to determine where things change if you have, say, one sequrence that requires scads & scads of bits (Explosions, rapid motion, high detail etc) and other sections that have large amounts of nothing much at all going on (Scenic panoramas, etc).
    The point is, it can all go horribly wrong if you are not careful & I would highly recommend investing in some RW discs to avoid the inevitable coasters when learning all the settings & options (I know I wasted many discs until RW became available).
    Lots & lots of luck, but in the main it is (usually) better to let Encore handle the most important timeline automatically, and tweak where it doesn't matter.

  • POST request in a login script

    I have a strange problem when the variables that are passed to a PHP script dont get recognized in an equal statement. The java code :
    tring value, value2;
         try {
         BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
         URL url = new URL("................./admin.php");
         URLConnection connection = url.openConnection();
         connection.setDoOutput(true);
         System.out.println("Enter your username");
         value = stdin.readLine();
         value = URLEncoder.encode(value, "UTF-8");
         System.out.println("Enter your password");
         value2 = stdin.readLine();
         value2 = URLEncoder.encode(value2, "UTF-8");
         System.out.println("Acessing the ECHO server script");
         PrintWriter out = new PrintWriter(connection.getOutputStream());
         out.println("username="+ value);
         out.println("&password="+value2);
         out.close();
         BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
         String inputLine;
         System.out.println("Retrieving data");
         System.out.println("");
         while ((inputLine = in.readLine()) != null)
             System.out.println(inputLine);
         System.out.println("");
         in.close();
         catch (Exception e)
         System.out.println("Error: "+e);
         System.out.println("Processing Acomplished");In case somebody wonders, this is part of the php script
    if (isset($_POST['username']) && isset($_POST['password']))
    $username = $_POST['username'];
    $password = $_POST['password'];
    echo $username;
    echo $password;
    if ( $username == "1" && $password == "2" )
    echo "CORRECT";
    else
    echo "INCORRECT";
    }Now, the script successfuly recieved my data, and prints it back. However, whenever i try to check if the value is "1", for example, it always evaluates to FALSE. I am completely lost, because the script print back 1, and then says that 1 != 1
    I know it looks like script problem, but im almost sure that its not.
    Maybe the data that java post's is encoded differently or something, and the script cant really "interpret" it. Did anyone else encounter any problems with login scripts and java ?
    Sorry if this is a lame question, i'm just beginning....

    I know it looks like script problem, but im almost sure that its not.I'm almost sure it is. Check that it's not comparing the string "1" to the integer 1 or something. But the way you present it the problem is almost certainly in the PHP rather than the Java.

  • Itunes slows down when sharing music is enabled

    hi,
    i searched through the forums and i didn't see that exact issue so i decided to post it.
    as soon as i share my library itunes completely slows down.
    - starting to play songs takes 5 seconds and displays the rotating rainbow circle
    - rating songs takes 5 seconds also and displays the rotating rainbow circle
    - resuming play after pausing also
    there are two more interesting issues:
    - i have a few albums where it doesn't happen! the albums aren't encoded different, have the same version of tags, are on the same drive in an adjacent folder. i tried reimporting songs, placing it into different folders or harddrives. no changes.
    - only 2% of my library is shared and it seems like most of it is recently added music. but: no differences in encoding, tags, place on the harddrive. renaming, readding, moving the files didn't change the situation.
    i also disabled automatic updating of playlists, deleted all my playlist folders, reinstalled itunes, tried basically everything.
    what does itunes do in the network when playing, rating songs, ...? i'm using a fast wlan, but i don't think that's the issue or does itunes reexport the xml-file after every play? has it something to do with auto-update-play-counts after every song (which i couldn' find in the preferences)?
    any help would be greatly appreciated!
    regards,
    eric.
    by the way: i'd loooooove to see pandora-like functionality in the next major versin of itunes!!! :)))

    When you are sharing your iTunes, any other users you share with are accessing your hard drive and music foilder simultaneously with you. Since shared users are not playing exactly the same song at the same time as you, your hard drive's heads are scanning and reading from more points than they would be with you alone listening. There is a need to cache some part of the files for sharing, and that uses a bit of your RAM too. I guess it would be similar to saying that your car drives fine as long as you are driving it alone. Pile a few friends in with you, tow their cars behind yours, and suddenly, your car has nowhere near the performance it did with just you in it. Aside from adding more RAM, buying a fatser hard drive or stepping up your processor, this is simply an issue with sharing one system between more than one user at the same time, and it can't be remedied.

Maybe you are looking for