Options

Strange issue ASNI - ASCII

AstiniaAstinia Member Posts: 40
Hello everyone.

I have such a problem.
I have file with name 'münd.pdf' and in the NAV 2009 it stores like 'mu¨nd.pdf'.
So, the 'ü' actually replaces with 2 signs 'u¨'. Even if I replace this 2 sings with one 'ü' (252) - the FileSystem returns false on FileExists.

With others files I receive - everything looks fine. I don't know how many files I can have with such encoding.

Any ideas?

Answers

  • Options
    vaprogvaprog Member Posts: 1,118
    In Unicode there are two ways to represent the 'ü' character, precomposed (U+00FC) or composite (base letter 'u' (U+0075) plus combining diaeresis (U+0308)).

    If the unicode filename has to be converted into the system's non-unicode codepage, it succeeds for the precomposed character, if that characterset contains the lette 'ü', but fails for the composite one in any case.

    I don't quite understand what "in the NAV 2009 it stores like 'mu¨nd.pdf'." is supposed to mean. Looks like the combining diaeresis had been converted to a (non-combining) diaeresis for storage in NAV.

    You're probably fine, if you rename your pdf file to use the precompose umlaut, and also use this withing NAV. In Windows, this is the default behaviour of the system. Unfortunately in Mac OS it is not.
  • Options
    AstiniaAstinia Member Posts: 40
    Thanks for the fast reply!


    So, the only way is to rename file? I can't modify 'nav' name to the correct one? Cause unfortunatile, even if I insert 'ü' in the file name FileSystemObject won't find it.

    I tried with NAV virtual table File. It returns me the FileName with 'u¨' - but after I can't do nothing again with it.

    The problem is - I get those file-names in the database thru web-add-on. Afterwards I go thru all names and import those in the Attachment table. So, I need to get that file when it is in database but have different name than in the system.

    Is that usual to NAV to convert one symbol into two? I have 'hand-made' codeunit to parse ASCII to ANSI. I believed it always one symbol.

    Thanks
  • Options
    vaprogvaprog Member Posts: 1,118
    Unfortunately, with NAV 2009, there is no other option. You'd need a version of NAV that supports Unicode in order to properly store the filename within a NAV Text field.

    No ANSI to ASCII conversion will help you to sort this out. You might be able to automatically convert the decomposed umlaut to a precomposed one in NAV, but then you still would need to rename the file to use a precomposed umlaut too, or alternatively "teach" the system to ignore such differences when searching for a file to open by name. A proper Unicode implementation should actually use normalization in such a situation, I suppose.
  • Options
    AstiniaAstinia Member Posts: 40
    Thanks a lot.
    I decided to rename files when I upload them before the value from variable gets into NAV. So, I just rename it before storing that name in NAV
Sign In or Register to comment.