"""Convert ISO 8601 string to epoch milliseconds.

This function converts an ISO 8601 formatted datetime string to epoch milliseconds, matching the behavior of Java's `iso8601StringToEpochLong`. The function handles the 'Z' timezone indicator by replacing it with '+00:00' before conversion.

Args:
    iso8601_string: ISO 8601 formatted datetime string, e.g., '2023-10-01T12:34:56Z'.

Returns:
    int: Time as epoch milliseconds.
"""