Safari does the same as Firefox (is working):

selected file name: ABC_ä.png

charcode at 0 = 65 is char A
charcode at 1 = 66 is char B
charcode at 2 = 67 is char C
charcode at 3 = 95 is char _
charcode at 4 = 228 is char ä
charcode at 5 = 46 is char .
charcode at 6 = 112 is char p
charcode at 7 = 110 is char n
charcode at 8 = 103 is char g


> Am 03.11.2015 um 17:06 schrieb Alex Harui <[email protected]>:
> 
> I did some digging, and the implication of this article is that Firefox is 
> not handling UTF-8 in the file names, although as pointed out in the article 
> [1], Chrome’s handling breaks web sites.  What does Safari do?
> 
> -Alex
> 
> [1] 
> http://stackoverflow.com/questions/9975149/difference-firefox-chrome-when-encoding-umlauts
>  
> <http://stackoverflow.com/questions/9975149/difference-firefox-chrome-when-encoding-umlauts>
> 
> From: Marcus Fritze <[email protected] 
> <mailto:[email protected]><mailto:[email protected] 
> <mailto:[email protected]>>>
> Reply-To: "[email protected] 
> <mailto:[email protected]><mailto:[email protected] 
> <mailto:[email protected]>>" <[email protected] 
> <mailto:[email protected]><mailto:[email protected] 
> <mailto:[email protected]>>>
> Date: Tuesday, November 3, 2015 at 5:44 AM
> To: "[email protected] 
> <mailto:[email protected]><mailto:[email protected] 
> <mailto:[email protected]>>" <[email protected] 
> <mailto:[email protected]><mailto:[email protected] 
> <mailto:[email protected]>>>
> Subject: Re: serious problem with FileReferenceList in Chrome on Mac
> 
> Thank you very much for the useful tips.
> 
> Ok, when I select the file name
> 
> ABC_ä.png
> 
> result in Firefox on a Mac:
> 
> selected file name: ABC_ä.png
> 
> 
> charcode at 0 = 65 is char A
> charcode at 1 = 66 is char B
> charcode at 2 = 67 is char C
> charcode at 3 = 95 is char _
> charcode at 4 = 228 is char ä
> charcode at 5 = 46 is char .
> charcode at 6 = 112 is char p
> charcode at 7 = 110 is char n
> charcode at 8 = 103 is char g
> 
> result in Chrome on Mac:
> 
> selected file name: ABC_ä.png
> 
> charcode at 0 = 65 is char A
> charcode at 1 = 66 is char B
> charcode at 2 = 67 is char C
> charcode at 3 = 95 is char _
> charcode at 4 = 97 is char a
> charcode at 5 = 776 is char  ̈
> charcode at 6 = 46 is char .
> charcode at 7 = 112 is char p
> charcode at 8 = 110 is char n
> charcode at 9 = 103 is char g
> 
> 
> So the ä is in Firefox 228 (which is actually the correct code), but the ä is 
> in Chrome on a Mac 97 (code for the character a) and 776 (code for the 2 dots 
> over the a).
> 
> This issue occurs even when I don’t embed any font in my app.
> 
> So how can I solve this? Can I even solve this myself? Maybe it’s a Pepper 
> Player issue.
> 
> Here is my test-code:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <s:Application
> xmlns:fx="http://ns.adobe.com/mxml/2009";
> xmlns:s="library://ns.adobe.com/flex/spark"
> xmlns:mx="library://ns.adobe.com/flex/mx">
> 
> 
> <fx:Script>
> <![CDATA[
> import mx.controls.Alert;
> 
> 
> private var _refAddFiles:FileReferenceList;
> 
> 
> private function uploadTest():void
> {
> _refAddFiles = new FileReferenceList();
> _refAddFiles.addEventListener(Event.SELECT, onSelectFileRef);
> _refAddFiles.browse();
> }
> 
> 
> private function onSelectFileRef(event:Event):void
> {
> for each(var uploadFile:Object in _refAddFiles.fileList)
> {
> var dateiName:String = uploadFile.name;
> 
> 
> trace("selected file name: " + dateiName);
> 
> 
> var traceAlert:String = "selected file name: " + dateiName + "\n\n";
> 
> 
> for(var i:int = 0; i < dateiName.length; i++)
> {
> var traceStr:String = "charcode at " + i + " = " + dateiName.charCodeAt(i) + 
> " is char " + String.fromCharCode(dateiName.charCodeAt(i));
> 
> 
> traceAlert += "\n" + traceStr;
> 
> 
> trace(traceStr);
> }
> 
> 
> Alert.show(traceAlert);
> }
> }
> 
> 
> ]]>
> </fx:Script>
> 
> 
> <s:Button label="upload test" click="{uploadTest()}"/>
> 
> 
> </s:Application>
> 
> 
> 
> Am 02.11.2015 um 17:52 schrieb Alex Harui <[email protected] 
> <mailto:[email protected]><mailto:[email protected] <mailto:[email protected]>>>:
> 
> Try dumping the charCode for each character in the file name.  I wonder if
> you having some sort of double-byte or code page issue.
> 
> -Alex
> 
> On 11/2/15, 8:35 AM, "Marcus Fritze" <[email protected] 
> <mailto:[email protected]><mailto:[email protected] 
> <mailto:[email protected]>>> wrote:
> 
> Mhm, the font is Verdana. So nothing special.
> 
> But, when I set the fileRef.name to a TextField the file-name Test_ä.pdf
> is shown as Test_a.pdf
> 
> And when I move the cursor after the „a" in the TextField and press
> backspace, the invisible
> character will be deleted, when I press backspace again, the „a“ will be
> deleted.
> 
> But is my embedded font used when I save the file-name internally and
> upload the file-name to the server?
> 
> Maybe, I should test on a older OS X (and not the latest version).
> 
> Am 02.11.2015 um 17:21 schrieb Tom Chiverton <[email protected] 
> <mailto:[email protected]><mailto:[email protected] 
> <mailto:[email protected]>>>:
> 
> On 02/11/15 16:16, Marcus Fritze wrote:
> (where I use embedded font, it works)
> 
> Maybe the font doesn't have the correct glyphs.
> 
> Tom

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to