UTF encoding issues on file adapters and mappings

Hi,
We did some tests regarding to UTF-8 and UTF-16 encoding using file adapters. Our conclusion so far is (when using Windows OS):
1. Inbound adapter can handle UTF-8 and UTF-16 correctly, but do not specify the encoding!
2. XI mappings will set the XML encoding to UTF-8 correctly when sending an UTF-16 file to XI.
3. Outbound adapter can only handle UTF-8 (and US-ACSII and ISO-8859-1) correctly.
The exact test results are:
>>Outbound file adapter bug.
If no encoding is specified in the outbound file adapter, UTF-8 and UTF-16 are handled correctly. However if the encoding is set to UTF-16, XI mapping will fail with the error:
During the application mapping com/sap/xi/tf/_CHRIS_OUTBOUND_TO_INBOUND_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: Fatal Error: com.sap.engine.lib.xml.parser.Parser~
Part of the trace:
com.sap.aii.ibrun.server.mapping.MappingRuntimeException: Runtime exception occurred during execution of application mapping program com/sap/xi/tf/_CHRIS_OUTBOUND_TO_INBOUND_: com.sap.aii.utilxi.misc.api.BaseRuntimeException; Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) a0d, a0d, 6e3c(:main:, row:3, col:2) at com.sap.aii.ibrun.server.mapping.JavaMapping.executeStep(JavaMapping.java:72) at com.sap.aii.ibrun.server.mapping.Mapping.execute(Mapping.java:91) at com.sap.aii.ibrun.server.mapping.MappingHandler.run(MappingHandler.java:78) at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleMappingRequest
>>Inbound file adapter bug.
If the encoding of an inbound file adapter is set to UTF-16 everything works ok (except the XML encoding is not set correctly, but this may be a mapping issue and not an adapter issue). However the default UTF-16 encoding seems to be UTF-16BE, where I would expect UTF-16LE since this is the most commonly used encoding.
If the encoding UTF-16LE or UTF-16BE the characterset used in the message is correct, except the BOM of the file. The BOM is empty which means UTF-8 encoded file. Since the file is UTF-16BE or UTF-16LE encoded, this is wrong and the correct BOM should be added by the adapter.
Encodings like US-ASCII and ISO-8859-1 are handled correctly.
>>Mapping bug
When we send in a message encoded in UTF-8 and want to send it out as a UTF-16 encoded message, we need to set the XML encoding to UTF-16. Normally this is done by an XSLT mapping using the <xsl:output encoding=”UTF-16”/> command.
The UTF-8 message will get processed by the XSLT and any special character will be converted to its UTF-16 value. However the output message is not UTF-16 encoded (1 byte in-stead off 2 bytes).
When this 1 byte message is send to the inbound adapter (encoding is set to UTF-16) the message will be translated from 1 byte to 2 byte (UTF-8 to UTF-16). The characters that were converted from UTF-8 to UTF-16 will be read as single byte characters and will be converted again. This will result in an incorrect message with illegal characters.
So basically characters will be converted to UTF-16 2 times, which is incorrect.
Maybe someone can confirm this on another XI system (maybe different OS). If you need test files or mapping, please let me know.
Kind regards,
Christiaan Schaake.

Update after carefully reading all the UTF related documents on the internet.
For UTF-16 the BOM is required and the adapter is handling this correctly. (encoding=UTF-16 will create the BOM).
For UTF-16LE and UTF-16BE the BOM must not be set. The application should be able to handle the conversion. The adapter is working correct again.
If the adapter is set to binary mode in stead of the text mode, the file will always be read correctly.
About the mapping issue, I'm still experimenting with this one.
Kind regards,
Christiaan Schaake.

Similar Messages

  • Encoding issue for file manager

    I am using the ditto command to duplicate a file. This file has unicode filename and as per http://developer.apple.com/qa/qa2001/qa1173.html I am first normalizing the name to kCFStringNormalizationFormD and then converting it to utf-8 before calling ditto on it. This all works smoothly but when I try to get the FSRef using the original unicode name I get fnfErr. Dosn't the API CFURLGetFSRef convert the string to kCFStringNormalizationFormD? Or is there any alternate for ditto on Tiger.

    no encoding issues if i use xml (xlf or xliff) bundle as xml supports utf-8 encoding.

  • Issues with File Polling and File Copy in a Cluster

    Hi,
    I have a 2 node cluster of SOA 11.1.1.5. Running into an issue.
    I have a File Poll Process which picks up new files and then copy them over to another directory [using COPY operation of file adapter]. After that using FTP Adapter to ftp the file [using MOVE operation of FTP]. Now if I place a file Poll is creating 2 instances. I have configured HAFile Adapter and HAFTPAdapter. Now if I remove the file COPY operation I see only one instance as soon as I put back file copy it creates multiple instances again. Any idea what might be wrong.
    I am following the document for file copy and ftp move http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/adptr_file.htm#BABEBJAF section
    4.5 Oracle File and FTP Adapters Use Cases
    But in a cluster if I use file copy I see multiple instances of Polling instances.
    Thanks

    "puneet" <[email protected]> wrote in message
    news:3fcf4fa4$[email protected]..
    >
    Hi I use WLI studio to add a user in a clustered environment (admin + 2managed
    wli servers). I see the following message in the logs:
    ####<Dec 3, 2003 1:05:02 PM MST> <Warning> <Security> <suznd265><eflow_2323_wli
    managed_2> <ExecuteThread: '9' for queue: 'default'> <kernel identity><14:5a2cc
    dff10338da2> <090048> <Made an in-memory only change to the FileRealm.>
    As a result, the user, that I added is not actually visible to the othermanaged
    servers in the cluster. I have verified this by having only one managedserver
    up when adding the user. Once I have added the user, I boot the othermanaged
    server and bring the first managed server down. The user I have justcreated gets
    lost.
    This occurs if you make the change on the managed server. Can you make the
    change on
    the admin server? It should get pushed to the managed servers.

  • External List Management - Issue in File Upload and Map

    I am facing problem while maintaining external lists through ELM and executing step upload and map file for a tab separated text format file.
    The file data is getting shown properly in file preview through mapping format but when I execute it through external list the data is not getting uploaded at all.The log is not showing me any error or reason for the same.
    I want to know apart from basic ELM config, is there some other configuartion required to enable ELM to upload and map the file in turn.
    Message was edited by:
            Pratyasha Shishodia

    I got the resolution to this answer.
    The issue was the task under ELM workflow was not marked for background processing and hence it was always in ready state and never proceeded ahead thru ELM transaction.All the steps due  to this reason were shown in planned or ready state.
    There was no error in ELM as everything in the system had no issues and hence nothing came in error log.

  • Media Encoder Hangs on File Import and Playback

    Media Encode Hangs on launch (extremely slow not normal).  When I drag and drop a file it hangs or using file import it hangs. Encodes that should only take a few minutes are listed as 1 hour.
    I use media encoder all the time it does not perform like this!  Anyone else experiencing these problems?
    Thanks,
    System Info
    Z800 8 core 12Gig Memory Nividia FX5800 Adobe CC Suite lastest updates. (Media Encoder 7.2)

    Still experiencing unexpected behaviour when drag and droping files into project window.  I have draged the same file sometimes it loads instantly other times it takes as much as 3 minutes to load.  The file size is 354 mb.  No other programs are running.  Anyone have similar behaviour?

  • Encoding issues with Instant Client and Win-1252 database

    Hi,
    I'm connecting to a Win-1252-encoded Oracle XE database from a Ruby on Rails application via ruby-oci8.
    NLS_CHARACTERSET WE8MSWIN1252
    NLS_NCHAR_CHARACTERSET AL16UTF16
    When the database and the application reside on the same physical server, the application retrieves the correct characters from the tables. But if the database resides on a different machine, then I use Oracle Instant Client; unfortunately the characters I get back from the database are then incorrect ('e' instead of 'é', 'a' instead of 'à', etc.).
    Is there some kind of setting (or another version of the Instant Client) that I can use to fix this encoding problem?
    Thanks,
    Chris.

    Hi,
    >>then I use Oracle Instant Client
    It's possible that maybe a NLS environment variables configuration problem ... For more information, I advise you to take a look at [url http://www.oracle.com/technology/tech/globalization/htdocs/nls_lang%20faq.htm] NLS_LANG FAQ
    Cheers
    Legatti

  • Regarding advenced mode option at sender,reciever file adapters

    hi.
    can any xi prof tell about the use of advanced mode at sender,reciever file adapters.
    and one more thing that i foung difference is at sender  adapter advanced mode 
    there are some options like msecs to wait before modification check and the other one is maximum file size bytes .
    waiting for any great response.
    u r great answer would be appreciated.
    bye.
    regards.
    seeta ram.

    check out this thread
    Re: Dynamic file name in Receiver File Adapter
    Check these also .
    /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
    /people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution
    http://help.sap.com/saphelp_nw04s/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm
    hope this can help u

  • Regarding File Adapters

    Hello
       I am working on File Adapters and would like to know as to how do you go about specifying the record substructure when you select the File Content Conversion in the Message Protocol of the Adapter configuration.I went through the help content on XI but was not clear.
    Thanks and Regards

    Hi Sharat,
    Please go through these links:
    /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
    /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
    I hope if it helps, you'll give me points.
    Thanks & Regards
    Varun Joshi

  • Encoding Issue : JMS and Mapping : utf-8 iso8859-1

    Hi All,
    I am facing some problem with encoding issue.
    Scenario :  JMS -->  SAP PI --> JMS
    Requirment : Input plain text file contain some special characters,"©®" . Based on this condition,In Java Mapping
                       we check the Payload and changed the 'encoding' tag to UTF-8 or   ISO8859-1.                                                     
                   : <?xml version="1.0" encoding="UTF-8"?>     in the target XML output.
    While testing in Operation mapping our Java mapping works fine. as the encodeing tag changes from
                 UTF-8 to ISO8859-1 if the special character exists.But if I test the same in Integration Directory(Test Configuration)
                 or did a end to end  testing. The encoding tag did'nt changes.
    For testing we had to a set of Plain Text files with UTF-8 and ISO8859-1 .
    I tried the options of using beans in Adapter modules in Sender JMS channel.
    MessageTransformBean, TextCodepageConversionBean, XmlAnonymizerBean
    These doc & threads ,was also referred[How to Handle Encoding in PI|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42]
    Regards,
    Ashutosh R

    Hi
    public static boolean fixSpecialCharforWeb(String text) {
            int i = 0;
            Character c = null;
            char[] ctext = null;
            StringBuffer newText = new StringBuffer("");
            //boolean encodingType = false;
            if ((text == null) || (text.trim().length() == 0)) {
                return encodingType;
            } else {
                try {
                                   for (i = 0; i < text.trim().length(); i++) {
                        ctext = text.trim().substring(i, i + 1).toCharArray();
                        c = new Character(ctext[0]);
                        //Single quote
                        if ((text.trim().substring(i, i + 1).equals("'")) || (c.hashCode() == 8217) || (text.trim().substring(i, i + 1).equals("?")) || (c.hashCode() == 146) || (c.hashCode() == 145)) {
                            //newText.append("'");
                            encodingType = true;
                            return encodingType;
                        //Double quotes
                        if ((c.hashCode() == 8220) || (c.hashCode() == 8221) || (c.hashCode() == 147) || (c.hashCode() == 148)) {
                            //newText.append(""");
                            encodingType = true;
                            return encodingType;
                        // bullet point
                        if ((c.hashCode() == 8226) || (c.hashCode() == 149)){
                            encodingType = true;
                            return encodingType;
                        // tilde
                        if ((c.hashCode() == 732) || (c.hashCode() == 152)){
                            encodingType = true;
                            return encodingType;
                        // Soft Hypen
                        if (c.hashCode() == 173){
                            encodingType = true;
                            return encodingType;
                        // En-Dash
                        if ((c.hashCode() == 8211) || (c.hashCode() == 150)) {
                            encodingType = true;
                            return encodingType;
                        // Em-Dash
                        if ((c.hashCode() == 8212) || (c.hashCode() == 151)) {
                            encodingType = true;
                            return encodingType;
                        // Euro Sign
                        if ((c.hashCode() == 8364) || (c.hashCode() == 128)) {
                            encodingType = true;
                            return encodingType;
                        // Yen Sign
                        if (c.hashCode() == 165) {
                            encodingType = true;
                            return encodingType;
                        // Pound Sign
                        if (c.hashCode() == 163) {
                            encodingType = true;
                            return encodingType;
                        // 1/2 sign
                        if (c.hashCode() == 189) {
                            encodingType = true;
                            return encodingType;
                        // 1/4 sign
                        if (c.hashCode() == 188) {
                            encodingType = true;
                            return encodingType;
                        // 3/4 sign
                        if (c.hashCode() == 190) {
                            encodingType = true;
                            return encodingType;
                        // Sword/dagger
                        if ((c.hashCode() == 8224) || (c.hashCode() == 134)) {
                            encodingType = true;
                            return encodingType;
                        // Trademark
                        if ((c.hashCode() == 8482) || (c.hashCode() == 153)) {
                            encodingType = true;
                            return encodingType;
                        // Ampersand &
                        if ((text.trim().substring(i, i+1).equals("&")) || (c.hashCode() == 38)) {
                            encodingType = true;
                            return encodingType;
                        //Registered mark
                        if ((text.trim().substring(i, i + 1).equals("?")) || (c.hashCode() == 174)) {
                            //newText.append("®");
                            encodingType = true;
                            return encodingType;
                        //Copyright mark
                        if ((text.trim().substring(i, i + 1).equals("?")) || (c.hashCode() == 169)) {
                            encodingType = true;
                            return encodingType;
                        // Question.
                        if (c.hashCode() == 63 && c.toString().equals("?")){
                            //newText.append("?");
                            encodingType = true;
                            return encodingType;
                        //handling symbol ?
                        if ((text.trim().substring(i, i+1).equals("?")) || (c.hashCode() == 233)) {
                            encodingType = true;
                            return encodingType;
                        if ((text.trim().substring(i, i+1).equals("?")) || (c.hashCode() == 232)) {
                            encodingType = true;
                            return encodingType;
                        if (c.hashCode() == 144) {
                            encodingType = true;
                            return encodingType;
                } catch (Exception e) {
                    e.printStackTrace();
            return encodingType;

  • Embedding HTML in XML CDATA and encoding issues

    Hi all,
    I'm embedding HTML code in a CDATA section. My problem is that, depending on the document, the HTML can be encoded in many formats. I borrowed a piece of code that sniffs that format so i can create String in the "right" encoding (or at least the one that was guessed).
    - If I directly injected those in the CDATA section, i guess they'd be encoded in UTF-8 and some character would be misinterpreted?
    - What if i would transcode the HTML from the sniffed format to utf-8?
    -Are there any issues woth doing this?
    Sorry if this is a dumb question but I'm quite new to that kind of encoding issues.
    BTW i'm using DOM.
    Thanks
    lexo

    I don't know if it's a dumb question. I just don't understand it at all. Encoding issues only arise when you write data from a Java program to an external location, or when you read data from an external location into a Java program. And none of the activities you mentioned there have anything to do with that.
    When you write your XML to an external file, or wherever you write it to, it gets encoded at that moment. The whole thing. Elements, attributes, CDATA sections, the whole thing. Doesn't matter what's in it, the whole thing gets encoded in whatever charset was chosen.
    Does that help?

  • Encoding issue - having UTF-16LE BOM "FF FE"

    Hello Experts,
             The scenario is as follows:
    SAP sends IDOCS -> SAP-PI (collects IDOCS & creates IDOC xml) -> Content conversion done at Receiver CC -> Text File having pipe delimited is placed in an FTP location.
    Requirement :
    Currently SAP R/3 is sending Balkan and Cyrilllic chracters to PI. Both SAP-R/3 and PI are Unicode compliant. SAP-PI version being used  is SAP-PI 7.1. BPM is used to collect the idocs based on time.
    The SAP-PI while converting the IDOC to idoc XML, it has header as "encoding=UTF-8".
    The text file that is getting created at the FTP location is an ANSI file. (If you open the text file with EDITPLUS(ver3) tool, you can check the file type as ANSI. )We need to change this as UTF-16LE.
    In the receiver CC, in the first Target tab, we have maintained Transfer Mode as "Binary" in FTP connection parameters.
    In the Processing tab, we have maintained the File type as Text and Encoding as "UTF-16LE".
    We also switched from Binary-Binary, Binary-Text and Text-Text in both the tabs, but the file that is getting put, is still an ANSI file in the FTP location.
    In PI all the characters are coming correctly. But the time of creating the file, the file is getting created as ANSI.
    We need to have the file type as UTF-16 having BOM(Byte Order Mark) as "FF FE". If you open in the EDITPLUS text editor, it should show as UTF-16.
    Please if any of you experts have come across any solution for this issue, please let me know the steps. It an issue in production and need your help asap.
    Points to be awarded to the best answer and an answer that helps us solve the problem.
    Thanks.
    Deb.

    from another discussion in SDN forum, I have learned that PI does not add a BOM.
    UTF-16LE and UTF-16BE do not have a BOM, as the byte order is clear from declaration.
    So you have to add the BOM with an OS script.
    When you put UTF-16LE in receiver channel, the target file should be in UTF-16LE. if this does not work, check if UTF-16LE is installed in server, where PI is running. But if it is missing, an error message would happen in channel monitor.
    You have to check the encoding of the file with a hex editor. You cannot verify this with with Notepad or any other text editor.

  • Encoding issue in importing file using myfaces

    Hi,
    I are trying to upload a XML file (with UTF-8 encoding) in our JSF UI using myfaces "inputFileUpload" option. But when I am trying to read the file using org.apache.myfaces.custom.fileupload.UploadedFile.getInputStream() API, looks like the encoding is not being preserved and I am getting Scandinavian characters as ‘?’. I have checked this by writing the read contents to a file via stream which is UTF-8 encoded.
    How can I preserve the character encoding while reading from the uploaded file?
    Thanks.

    Since UploadedFile.getInputStream() returns an InputStream, you can impose the character encoding when you wrap it with a Reader.

  • Receiver File Adapter - Encoding issue.

    Hi Everybody,
    The file format (encoding) is different to the format generally we used to get.
    Currently we are get the flat files in DOS format.The current file when we are downloading it we are getting it in the UNIX or other format.
    For eg: 20 has been changed to 0D in the file.
    Can somebody help me on the same.
    Thanks,
    Zabiulla

    Hi,
    Check on this for file adapters
    Text
    Under File Encoding, specify a code page.
    The default setting is to use the system code page that is specific to the configuration of the installed operating system. The file content is converted to the UTF-8 code page before it is sent.
    Permitted values for the code page are the existing Charsets of the Java runtime. According to the SUN specification for the Java runtime, at least the following standard character sets must be supported:
    &#9632;       US-ASCII
    Seven-bit ASCII, also known as ISO646-US, or Basic Latin block of the Unicode character set
    &#9632;       ISO-8859-1
    ISO character set for Western European languages (Latin Alphabet No. 1), also known as ISO-LATIN-1
    &#9632;       UTF-8
    8-bit Unicode character format
    &#9632;       UTF-16BE
    16-bit Unicode character format, big-endian byte order
    &#9632;       UTF-16LE
    16-bit Unicode character format, little-endian byte order
    &#9632;       UTF-16
    16-bit Unicode character format, byte order
    Regards
    Vijaya

  • [SOLVED] File name encoding issue

    Hi all,
    I have a large series of files with accented characters, they were all displayed nicely, but at some point, when I copied them to another computer, the characters were replaced by codes, for instance: "ó" --> "ó".
    +Renaming ie. "Pasó" (bad encoding of "Pasó") --> Pasó, while writing it, it shows the correct character, but when pressing enter the name remains ("Pasó")
    +If I rename the file to something else and then to the correct name, it will accept it: Pasó --> Pas --> Pasó will display correctly.
    I don't know if it's a system wide encoding issue because new files are displayed correctly, but I would like to know if I have to change file names manually to make them right.
    PS. When copying bad encoded files to another FS (like a USB drive), nautilus and bash refuse to copy them.
    Last edited by Wasser (2012-09-17 21:10:52)

    My fstab:
    # /etc/fstab: static file system information
    # <file system> <dir> <type> <options> <dump> <pass>
    tmpfs /tmp tmpfs nodev,nosuid 0 0
    # /dev/sda2 LABEL=ROOT
    UUID=d2243d9c-b8e7-442a-8446-5a43a4d9221b / ext4 rw,relatime,data=ordered 0 1
    # /dev/sda5 LABEL=HOME
    UUID=e67f5cfa-3ec3-4c06-9c2c-62c4cc188ffe /home ext4 rw,relatime,data=ordered 0 2
    # /dev/sda3 LABEL=VAR
    UUID=caac4924-2a13-4c97-9926-668ac0595ba3 /var reiserfs rw,relatime 0 2
    # /dev/sda1 LABEL=UEFI
    UUID=1E70-6485 /boot/efi vfat rw,relatime,fmask=0022,dmask=0022,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 2
    # /dev/sda4
    UUID=14993c2e-4bc4-42e4-b2e5-9dbc286abb4c none swap defaults 0 0
    Files in question are in /dev/sda5 (HOME)
    Last edited by Wasser (2012-09-16 08:37:52)

  • Media Encoder rendering MP4 files with AAC and M4V files leftover

    Hey all,
    Just a quick question. My computers' media encoder has started rendering mp4 files and leaving the m4v and aac files there once the render is complete. The mp4 is fine but it's a bit anoying and messy that it's not deleting the files afterwards. Anyone familiar with this issue?
    Thanks

    Sorry my computer AND media encover version. I run Creative Cloud on a new Mac Pro
    File seems to render fine
    Log info:
    - Source File: ***
    - Output File: ***
    - Preset Used: Match Source - High bitrate
    - Video: 1920x1080 (1.0), 25 fps, Progressive, 00:00:42:17
    - Audio: AAC, 320 kbps, 48 kHz, Stereo
    - Bitrate: VBR, 1 pass, Target 10.00 Mbps, Max 12.00 Mbps
    - Encoding Time: 00:13:13
    04/27/2015 03:55:51 PM : File Successfully Encoded
    No errors reported.
    And this is what I end up with.
    Is that helpful?

Maybe you are looking for

  • Choosing which email address to be used in an alert?

    I ical is a great organizational app. I have gone to this forum hoping to find someone else who has tried to do what I want to do, use this to alert another person via email. I "clicked" on the alarm catagory, "clicked" on the email choices, and I am

  • Refresh of Webi in BI Launch Pad : "Failed to connect to the olap source"

    Dear all, I have a Web Intelligence document based on a BEx Query (BICS connectivity via an OLAP Connection configured with SSO) Behaviour : in Web Intelligence Rich Client (2 tier and 3 tier) : refresh is OK in BI Launch Pad : refresh is not OK : Wh

  • Workflow and Adobe Products. Is Lightroom the best way to go?

    I am somewhere between a serious hobbyist and pro just based on shear number of photos I take and because in shoot in RAW. I've been using Elements for years. I'm dedicating my year to upping my game process wise at least. I added Bridge but it doesn

  • Machine goes to sleep faster than Energy Saver settings

    Hi all, (I've searched for existing threads aboutthis but couldn't find any. Hope I'm not "re" posting) I use my laptop (MBP 2.4, 8gb, INtel Core i7) to play music live, so I need it to not go to sleep for at least... 30-40 minutes as I will frequent

  • SQL developer starts and then disappears without any warning

    Hi, guys: I need to use SQL developer where there are existing connections. however, SQL developer 3.1 asked the java.exe location, and I chose java 6, now I can launch SQL developer but not able to continue running it. SQL developer starts and then