I am having an issue when I am trying to parse a .csv file and process it via SOAP to Salesforce.com using their API
This is the first time this has happened and I need some guidance on what I can do to correct this
I am reading the file, each record is an array:
[DIST_NAME] => company
[PARENT_BRANCH] => H387
[PROJECT_NAME] => Bussplex
[END_PRODUCT] => Vehicle instrumentation
[CUSTOMERNAME] => Customer
[RECORD_CREATION_DATE] => 4/22/2008
[BOARD_NAME] => Main board
[PROTOTYPE_DATE] => 3/7/2008
[PRODUCTION_DATE] => 6/6/2008
[BOARDSPERYEAR] => 500
[BOARD_DESIGN_PHASE] => Prototype
[BOARD_FUNCTION] => CPU
[REG_ID] => 999999999
[REG_NO] =>
[STATUS] => Pending
[PENDING_DATE] => 3/28/2008 8:56
[WIN_DATE] =>
[REG_PART_FAMILY] => 13442
[REG_PART_SUPPLIER_PART_NO] => 13442EASA+
[REG_PART_PRICE] => 2.04
[REG_PART_QTY_PER_BOM] => 9
[AM_NAME] => João Carlos Boaventura
[FAE_NAME] => João Carlos Boaventura
[CUSTOMERENGINEER] => João Carlos Boaventura
[OFFICE_PHONE] => 555-1212
[EMAIL] => hisemail@company.com
[EXT_COMMENTS] =>
[APPR_REJ_REASON] =>
[RENEW_DATE] =>
Every file processed fine until we started receiving text with foreign characters:
João
I know that I could just use strtr to correct each value of the array, one by one,
What I am looking to do is clean the whole entire record/array, so if this comes in from the .csv file:
[AM_NAME] => João Carlos Boaventura
[FAE_NAME] => João Carlos Boaventura
[CUSTOMERENGINEER] => João Carlos Boaventura
I can replace it with
[AM_NAME] => Joao Carlos Boaventura
[FAE_NAME] => Joao Carlos Boaventura
[CUSTOMERENGINEER] => Joao Carlos Boaventura
I tried this
array_map('translate',$data);
function translate($string)
{
$search = 'ãäåö';
$replace = 'aaao';
$string = strtr($string, $search, $replace);
return $string;
}
but of coarse it is not working
Does anyone have some function or some idea of what I need to do
Hope this makes sense
~Mike